danb35 / freenas-iocage-nextcloud

Script to create an iocage jail on FreeNAS for the latest Nextcloud 28 release, including Caddy, MariaDB or PostgreSQL, and Let's Encrypt
GNU General Public License v3.0
252 stars 71 forks source link

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) #145

Closed adrido closed 3 years ago

adrido commented 3 years ago

Happens on a fresh installation of FreeNAS-11.3-U4.1

log and config attached. nextcloud-config renamed to nextcloud-config.txt

steps to reproduce:

create new dataset nextcloud in DatenPool1 run the script.

...
* Starting nextcloud
  + Started OK
  + Using devfs_ruleset: 6
  + Configuring VNET OK
  + Using IP options: vnet
  + Starting services OK
  + Executing poststart OK
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Command: mysql -e CREATE DATABASE nextcloud; failed!
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
...

nextcloud.log nextcloud-config.txt

danb35 commented 3 years ago

That makes it look like mysql isn't running. What's the output, in the jail, of service mysql status? And if it isn't running, service mysql start?

adrido commented 3 years ago
root@nextcloud:~ # service mysql status
mysql does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
root@nextcloud:~ #

root@nextcloud:~ # service mysql start
mysql does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
root@nextcloud:~ #
adrido commented 3 years ago

Reinstalled it today and now all works fine. Thank you for your script.