Wednesday 12 October 2011

MySQL startup issue

If you are facing problem in starting the mysql server try to start mysqld with the option –verbose it will tell what is the problem or you can also check the problem by your error log file.


Take a case here

abdul@system:~$ mysqld --verbose --user=mysql –datadir=/var/lib/mysql/ &

[1] 2975

abdul@system:~$ 111013 10:42:35 [Warning] '--log_slow_queries' is deprecated and will be removed in a future release. Please use ''--slow_query_log'/'--slow_query_log_file'' instead.

111013 10:42:35 [Warning] Can't create test file /var/lib/mysql/OSS-240.lower-test

111013 10:42:35 [Warning] Can't create test file /var/lib/mysql/OSS-240.lower-test

mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)

111013 10:42:35 [ERROR] Aborting

111013 10:42:35 [Note] mysqld: Shutdown complete



Above wee see that we are getting error code 13.means its permission issue login as root and now try.


root@system:~$mysqld --verbose --user=mysql --datadir=/var/lib/mysql/ &


now mysql is running & working properly.


But one point you should consider in mind is that we have written –user=mysql.

Always try to start your mysql server as mysql user if you start it as root its not a good practice.


No comments:

Post a Comment