MySQL start fails
$ sudo service mysql startstart: Job failed to start
Troubleshoot
-
Try to find out what is wrong.
- Start mysqld manually in verbose mode
$ sudo mysqld --verbose --user=root
- Check dmesg
$ dmesg
- Start mysqld manually in verbose mode
- Mysqld start manually (Step1) without any error, however, `sudo service mysql start` still fails. Check following settings are proper in your /etc/mysql/my.cnf;
# The MySQL server[mysqld]user = mysqlpid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockport = 3306basedir = /usrdatadir = /var/lib/mysqltmpdir = /tmplc-messages-dir = /usr/share/mysql
MySQL crashes under heavy load on Webserver.
Simulate heavy traffic
$ ab -n 1000 -c 100 http://yourdomainname/ab : Apache HTTP server benchmarking tool
-n number of requests
-c concurrent requests
General cause
- Generally mysql crashes because it runs out of memory.
-
Check innodb settings if your using it. Default innodb_buffer_pool_size is 128M which is very high for low footprint server. Change it to 16M.
-
Use mysql tunner script.
Download: https://github.com/rackerhacker/MySQLTuner-perl
-
Check innodb settings if your using it. Default innodb_buffer_pool_size is 128M which is very high for low footprint server. Change it to 16M.
- There could be other reasons also. Execute dmesg or look at mysql logs. Path for MySQL logs are specified in mysql.cnf.
No comments:
Post a Comment