Hi Guys,
I have ubuntu 14.04, and hosted some websites with database, all the services are running good, but this morning some websites having issue with database connection error I have checked the status of mysql by executing
/etc/init.d/mysqld status — > status was stopped
then I started the mysql and its working fine now, but am not able to find the issue why the server was suddenly stopped How to find the log for this and suggestion please thanks in advance.
What your log says? Check for mysql logs under /var/log/mysql.log or /var/log/mysql/mysql.log
- Enable MySQL Error log and Slow Query log to dig the error.
log-error=/var/log/mysqld.log
log_slow_queries=/var/log/mysql/slow-query.log
Reload the server after the change.
-
Use MySql tuning script to tweak your server, also check innodb buffer pool size. Hope you will get recommendations once after you run the tunner.
https://launchpad.net/mysql-tuning-primer
-
Install innotop to monitor the real time queries.
yum install innotop
Definitely you could find a hint from the above mentioned methods…
thanks its helped me lot after installing the innotop in my server having clear picture about the same