chkconfig not automatically starting mysql
8,023
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.
Related videos on Youtube
Author by
EGr
Updated on September 18, 2022Comments
-
EGr almost 2 years
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.
-
Kyle almost 11 yearsIs it able to start at all? Are you getting errors in the mysql logs?
-
EGr almost 11 yearsIt starts fine if I run
service mysql start
, but not at boot. My/var/log/mysqld.log
file only shows from the point I ranservice mysql start
. -
Stefan Lasiewski almost 11 years
ps aux |grep mysql
. It there another MySQL daemon running already? -
EGr almost 11 yearsNo mysql process was running until I started it myself.
-
-
EGr almost 11 yearsAre you talking about runlevels? If so, both
network
andmysql
are set to 2,3, and 5 -
Wojciech Domalewski about 8 yearschkconfig mysqld ...
-
anastrophe about 8 yearsNot necessarily, it depends upon the distribution.