1

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.

EGr
  • 609
  • 4
  • 14
  • 29

3 Answers3

4

Perhaps something went wonky when the init script was installed. I'd recommend the following:

chkconfig --del mysql
chkconfig --add mysql
chkconfig mysql on

Certainly can't hurt.

anastrophe
  • 5,488
  • 2
  • 16
  • 16
0

Are you starting up MySQL at the correct init level ? the network services should be up before mySQL can be started . S

  • Are you talking about runlevels? If so, both `network` and `mysql` are set to 2,3, and 5 – EGr Aug 12 '13 at 21:45
0

mysql is the client. If you have installed mysql server before, you can start it with

service mysqld start

Please check:

chkconfig mysqld