Newbie question: Runing NGINX +PHP fastCgi + MySql. Everything was working fine untill I did a hard reboot. Now, I can access mySQL via command line, however i am getting errors that its not running from my Drupal site . Is that a easy answer to this that I am missing. Thank you very much for your help
My hunch is that the socket file was moved. There are a few ways to fix this. For example, set "mysql.default_socket =" in php.ini, or "socket=" in the [client] section of my.cnf.
1. Create the /var/mysql directory (sudo mkdir /var/mysql) and then create a symbolic link from /tmp/mysql.sock to /var/mysql/mysql.sock (with: sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock).
2. Edit the /etc/php.ini file so that the mysql.default_socket = /var/mysql/mysql.sock and mysqli.default_socket = /var/mysql/mysql.sock.
3. Edit /etc/mysql/my.cnf adding the following lines:
[mysqld]
socket=/var/mysql/mysql.sock
[client]
socket=/var/mysql/mysql.sock
I have also tried to chmod the /var/run/mysqld folder to 777. Any ideas would be greatly appreciated. Thank you
I guess the next thing I would try is confirm I could locate the socket file with MySQL running and then try establishing a connection with a test PHP script. You can specify the socket path with the PHP mysql_connection function. That, or following up with mysql_error should tell you what the problem is if it's not the sock file.