cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Ouch, MySQL Table Crashed!

Level 9

You're using Storage Manager, for your storage monitoring and you get an error message in your Web console or log files:

     java.sql.SQLException: Table '<table name>' is marked as crashed and last automatic(?) repair failed

What does it mean, and how do you fix it?

Two possibilities for finding and fixing MySQL table crashes

MyISAM storage engine

The MySQL database uses MyISAM as a default storage engine, and the MyISAM table is easily corrupted.

But take heart, you can use the MyISAMCHK command to resolve crashed tables. The article, How to Run a myisamchk to Resolve Crashed mysql Tables, provides detailed instructions on using the MyISAMCHK commands for Windows and Linux to resolve crashed MySQL tables in your Storage Manager powered by Profiler product.


More MyISAMCHK options

The MySAMCHK provides other useful commands such as:

  • Identify all corrupted tables
  • Repair corrupted tables
  • Perform check and repair together for the entire MySQL database
  • Allocate additional memory for a large MySQL database
  • Get information about tables

For more information on these and other MYSAMCHK options, see How to Repair Corrupted MySQL Tables Using MyISAMCHK

Anti-virus, intrusion detection, or back up software is blocking MySQL

A common cause for crashed tables in MySql is antivirus, intrusion detection, or backup software. This can happen when these programs lock files in the MySQL database while Storage Manager is trying to use the files.

To prevent conflicts, add exceptions to these tools so they do not access the <STM Server Install Directory>\mysql folder and sub folders. Storage performance monitoring simplified!

Share your MySQL table crashes

I'd like to hear about your experience with MySQL table crashes, and how you fixed them with your storage performance monitoring software.

pastedImage_0.png

2 Comments
Level 8

Important thing to remember is to STOP  the mariadb service first and then to run this syntax afterwards:

windows:

c:\program files\solarwinds\storage manager server\mariadb\data\storage\

for %i in (*.MYI) do ..\..\bin\myisamchk --defaults-extra-file=..\..\my.cnf --check --analyze -r -v %i

OR

linux:

/opt/Storage_Manager_Server/mariadb/bin/

./myisamchk --defaults-extra-file=../my.cnf --check --analyze -r -v ../data/storage/*.MYI

Let that run and, when finished, check the <install path>\mariadb\data\storage (if windows or) <install path>/mariadb/data/storage/ directory (if on linux) for ".TMD" files. If you find them, delete them and run the above command ) again.

If you do not find any, just start up the mariadb service, let it run for 2 minutes or so and then start up the rest of the Storage Manager services.

Level 15

This is helpful information.  Thanks for the post!

About the Author
I joined the SolarWinds ID team because want to use my skills and abilities towards a common goal, and I want know my contributions matter. I want to see the results of my efforts and work toward building something bigger than what I can accomplish on my own. I believe in the mystery of a can-do attitude, I am excited about new opportunities and knowledge, and I am glad to be part of the SolarWinds team. Before joining SolarWinds, I obtained a Masters and Bachelors degrees in Computer Science and spent 5 years with the IBM Tivoli ID team. I was trained as a technical writer to better fulfill my responsibilities in providing tools support to the ID team. In addition to these responsibilities, I lead a work group designed to organize efforts to use Web Analytics and statistics to drive and validate documentation improvement efforts. I transitioned to the Lead UI developer for a Transparent Development project and spent time learning and implementing social media strategies to improve user experience.