Sunday, February 26, 2012

MySQL Server: Can’t connect to local MySQL server through socket /tmp/mysql.sock

Server OS: FreeBSD 8.x

This mysql server cannot start mysql server service after shutting down.
Try to start manually using this command, but still got error.#/usr/local/etc/rc.d/mysql-server start

Step taken:

1) Check Error Log for mysql(in mysqldata/mysql/)
    # ee ----------------mysql.err
  
    ERROR start from this line:
    
120224 19:42:32 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-locking'

2) Try to find where the rules  '--skip-locking' stated

3) This rule stated in my.cnf located in mysql path
    # ee my.cnf

4) Comment the line like this
:    
port            = 3306
socket          = /tmp/mysql.sock
#skip-locking
key_buffer = 256M
:
:

5) Start the Mysql-Server command
    #/usr/local/etc/rc.d/mysql-server start

6) Check from some related command
    #ps ax     or
    #sockstat -4
    #top

7) Check in mysql path (mysqldata/mysql), pid file will auto created.
    -rw-rw----  1 mysql  mysql         6 Feb 27 10:36 thedomain.mysql-name-server.pid


0 comments:

Post a Comment