# MySQL error 2002



## oguruma (May 25, 2018)

I am attempting to set up a Nextcloud server in a jail. I am getting the following error


```
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
```
Based on the research I did, that generally means the sql server isn't running. This is a completely vanilla FreeNAS 11.1 jail. 

The entirety of the commands I have issued for this jail are:

```
pkg install mariadb101-server 
 sysrc mysql_enable=yes
service mysql-server start 
mysql_secure_installation
```
After the `mysql_secure_installation` is when I get the error message.

hostname.err log is 



```
180524 13:54:06 mysqld_safe Starting mysqld daemon with databases from /var/db/$
2018-05-24 13:54:06 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:54:06 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:54:06 34422743040 [Note] /usr/local/libexec/mysqld (mysqld 10.1.3$
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
180524 13:54:06 mysqld_safe mysqld from pid file /var/db/mysql/nextcloud.pid en$
180524 13:54:44 mysqld_safe Starting mysqld daemon with databases from /var/db/$
2018-05-24 13:54:44 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:54:44 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:54:44 34422743040 [Note] /usr/local/libexec/mysqld (mysqld 10.1.3$
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
180524 13:54:44 mysqld_safe mysqld from pid file /var/db/mysql/nextcloud.pid en$
180524 13:55:15 mysqld_safe Starting mysqld daemon with databases from /var/db/$
2018-05-24 13:55:15 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:55:15 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:55:15 34422743040 [Note] /usr/local/libexec/mysqld (mysqld 10.1.3$
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
180524 13:55:15 mysqld_safe mysqld from pid file /var/db/mysql/nextcloud.pid en$
180524 13:55:32 mysqld_safe Starting mysqld daemon with databases from /var/db/$
2018-05-24 13:55:32 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:55:32 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 13:55:32 34422743040 [Note] /usr/local/libexec/mysqld (mysqld 10.1.3$
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
180524 13:55:32 mysqld_safe mysqld from pid file /var/db/mysql/nextcloud.pid en$
180524 14:02:25 mysqld_safe Starting mysqld daemon with databases from /var/db/$
2018-05-24 14:02:25 34422743040 [Warning] option 'table_open_cache': unsigned v$
2018-05-24 14:02:25 34422743040 [Note] /usr/local/libexec/mysqld (mysqld 10.1.3$
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
180524 14:02:25 mysqld_safe mysqld from pid file /var/db/mysql/nextcloud.pid en$
2018-05-24 14:12:56 34424840192 [Note] InnoDB: Mutexes and rw_locks use GCC ato$
2018-05-24 14:12:56 34424840192 [Note] InnoDB: Uses event mutexes
```


Anybody have any ideas?[/cmd]


----------



## SirDice (May 25, 2018)

oguruma said:


> This is a completely vanilla FreeNAS 11.1 jail


PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives



> ```
> /usr/local/libexec/mysqld: Undefined symbol "fdatasync"
> ```


fdatasync(2) was added to FreeBSD 11.1. This error indicates you're trying to run 11.1 binaries on an older version.


----------



## ChrisBSD (Sep 7, 2018)

SirDice said:


> PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives
> 
> 
> fdatasync(2) was added to FreeBSD 11.1. This error indicates you're trying to run 11.1 binaries on an older version.



Sorry, not an expert here... what does one do in that situation?


----------



## SirDice (Sep 7, 2018)

ChrisBSD said:


> what does one do in that situation?


Because the error happens on a FreeNAS system, ask on the FreeNAS forums. If it's on a FreeBSD system, update the OS.


----------

