I have mysql set in chkconfig to automatically start when the system reboots:
root@myserver:~#chkconfig mysql
mysql on
However, this does not seem to be the case. When the system reboots, I get the following error on my PHP pages:
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
If I run service mysql start
, the PHP pages begin to work (the above error does not appear, and queries return values). Is this an inappropriate configuration on my part? What else do I need to do to get mysql to start correctly after a reboot?
Note: I'm running mysql on a SLES VM.