Centos – After restarting the server Mysql does not start working


I did restart my server using # reboot command
Then I tried to access the server panel which is CentOS webpanel I got this error

Warning: obfuscated: No such file or directory in /usr/local/cwpsrv/htdocs/admin/index.php on line 0
mysqld is stopped

Trying to start mysql server, please wait!
Try to restart CentOS Web Panel with command: service cwpsrv restart

**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf

Could not connect: No such file or directory

and got the following error when try to access the hosted website on the server : `Could not establish database connection. Please check the username, password and hostname in the config file, and if necessary set up the appropriate MySQL user and privileges.

`The Mysql failed to start

[root@server ~]# service mysqld start

MySQL Daemon failed to start.
Starting mysqld: [FAILED]

Best Answer

Mysqld will have written some useful information to you log files. The log file you need would normally be /var/log/mysqld.log but the CentOS panel may have put it somewhere else.

In my experience the MySQL log files are usually fairly easy to read and a bit of research with your favorite search engine will lead to a solution.