Discussion Locked

Starting MySQL as a Service

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I've been having trouble getting MySql to start as a service on my Linux box. When I type in:

service mysql start

I get the following result:

[root@donthyde mysql]# Starting mysql daemon with databases from /var/lib/mysql
021123 19:38:54 mysql ended

For some reason, MySQL suddenly just quits.

I try running MySQL after the above message and get:

ERROR 2002: Can't connect to local MySQL server through socket'/tmp/mysql.sock'

I am able to start MySQL manually however, by using the command (when in the MySQL root directory)

./bin/mysqld
or the safe_mysqld

Note though...
When I use the service mysql start command, although it says MySQL has ended, the daemon is still loaded in memory, but I can't quit it or use it. (use a PS -A to see it there)

This means that if I want to start MySQL, I must start it directly using the ./bin/mysqld script

Other than that, MySQL works ok!

I'd appreciate any support anyone can give!

Thanks!
Alan Owen
Student Computer Technician
Hermon School Department

9 replies

by roger

Alan, I don't know why mysql won't start as a service, but you can edit /etc/rc.d/rc.local and add the command /bin/mysqld to the bottom to force mysqld to start on a reboot. (You may need to add a space and & after the command to force it to loadin the background if your reboot locks when executing this line!)

by chris willhoite

I have the same problem on my computer. I found that if you creat the /tmp/mysql.sock file and then edit your cron files to not delet that file it should work. For some reason they decided to put a nessasary file in a directory that is cleaned out by most system default cron jobs.

by gbjoe

Yes, you need to have mysqld started. One way to do that is with chkconfig (I use a RH7.3 box):

chkconfig --level 35 mysqld on

Hope this helps

This discussion is closed to new replies.