MySQL crashes due to various reasons like hardware problem, unexpected system shutdown, power failure and many more. Before things get out from the hand, you should try to find out the reason of MySQL crash and fix it on time. You can try below steps when MySQL crashes.
MySQL crash also happens due to corrupted tables & indexes. Following are the reasons for table corruption:If MySQL server is killed in the middle of update operation.
You can try above things when MySQL crashes. If the reason behind crash is corrupted tables then you can repair the corrupt tables using MySQL repair commands or a 3rd party repair tool for MySQL.
- First check whether mysqld server is running or dies. If it dies then try to find out the reason by checking the server error log.
- It may happen that MySQL is crashing only on your system so try to find out the problems from your end.
- When crash happens, immediately stop the mysqld server using mysqladmin shutdown command and run myisamchk – silent -- force */* .MYI from the data directory. This command will check all myisam tables.
- Almost 95 % MySQL crash happens due to some specific queries. You can check which queries are killing server using mysqld query log.
- Test MySQL by running the test in mysql – test directory.
- Run fork_big.pl script.
- Use - - skip- external- locking to prevent external locking in mysqld server.
- When mysqld does not respond then run mysqladmin -u root processlist command. This command tells you about the status of all the current connections.
- Run mysqladmin -i 5 status to know the statistics of queries.
- Create a bug report and send it to MySQL official site.
- Check whether you are using latest patches for your OS or not.
- The crash could also happen due to defective hardware so try to troubleshoot it.
MySQL crash also happens due to corrupted tables & indexes. Following are the reasons for table corruption:If MySQL server is killed in the middle of update operation.
- A bug in mysqld killed MySQL server.
- Crashed data file.
- A bug in data storage engine.
- Data or index files have been accessed at the same time by some external program and mysqld at the same time.
You can try above things when MySQL crashes. If the reason behind crash is corrupted tables then you can repair the corrupt tables using MySQL repair commands or a 3rd party repair tool for MySQL.
No comments:
Post a Comment