These forums are read-only!
MySQL server
  • 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.

    Google: "php mysql sock location"
  • jmstacey- Thank you for the response. I will look into that right now.
  • I've tried the follow that have not worked:

    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
  • maybe a dumb question, but did you restart the services after updating the cnf files?
  • 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.