Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Environment: Solaris 10

This MySQL server has been up and running for 6 months now. Today all of a sudden it crashed. When typing 'mysql' as user it gives the error MYSQL" Error 2002 (HY000): Can't Connect to Local MySQL server though socket '/tmp/mysql.sock'. When typing mysql as root it says mysql: not found.

The server try to open MySQL, it stays open for 9-10 seconds and restarts the process. Below are the application logs.

Application-database-mysql_mysql-csk.log
[ May 30 22:37:52 Enabled. ]
[ May 30 22:37:58 Rereading configuration. ]
[ May 30 22:37:59 Executing start method ("/opt/coolstack/lib/svc/method/svc-cskmysql start") ] /opt/coolstack/mysql/bin/mysqld_safe --user=mysql --datadir=/dbpool1/data --pid-file=/dbpool1/data/database.soliaonline.com.pid
[ May 30 22:37:59 Method "start" exited with status 0 ]
[ May 30 22:38:13 Stopping because all processes in service exited. ]
[ May 30 22:38:13 Executing stop method ("/opt/coolstack/lib/svc/method/svc-cskmysql stop") ]
[ May 30 22:38:13 Method "stop" exited with status 0 ]
[ May 30 22:38:13 Executing start method ("/opt/coolstack/lib/svc/method/svc-cskmysql start") ]
/opt/coolstack/mysql/bin/mysqld_safe --user=mysql --datadir=/dbpool1/data --pid-file=/dbpool1/data/database.soliaonline.com.pid
[ May 30 22:38:13 Method "start" exited with status 0 ]
[ May 30 22:38:25 Stopping because all processes in service exited. ]
[ May 30 22:38:25 Executing stop method ("/opt/coolstack/lib/svc/method/svc-cskmysql stop") ]
[ May 30 22:38:25 Method "stop" exited with status 0 ]

I am hoping someone might have run into this before and might know how to fix it.

share|improve this question
    
What does "svcs mysql" say ? –  Geraint Jones May 31 '10 at 4:52
add comment

2 Answers

For anyone else who encounters a similar problem.

The indexes for all of the innoDB tables had corrupted. The one thing I was able to do in the end is run a force-recovery.

http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html

When I had posted this I had already tried force-recovery = 4 and that was unsuccessful, so I figured it would not work at all.

Although in the end I was able to get force-recovery =2 to work and allowed me to gain access to the data.

After backing everything up, I repaired the indexes and the server was fine from there on out.

share|improve this answer
add comment

My first thought would be to check the MySQL logs themselves, probably in /dbpool1/data/$hostname.err

Maybe it can shed some light on why MySQL isn't starting. Alternately, executing the start command manually may also help:

/opt/coolstack/mysql/bin/mysqld_safe --user=mysql --datadir=/dbpool1/data --pid-file=/dbpool1/data/database.soliaonline.com.pid

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.