Table __________ is marked as crashed and should be repaired.
By: Emiley J. in MySQL Tutorials on 2008-09-18
Recently a friend of mine called me at 12 midnight. His voice was shaky and had a sense of urgency. "My Site is down. Can you help me with it?". I told him, "Its midnight here, do you mind?". He didn't seem to like my sense of humour. He was in panic. I recalled that his site was entirely dynamically generated with PHP and MySQL. All the pages were dynamically generated from the database. So if the database is down, his site is down.
I immediately got up and woke my computer too. It was no surprise that the first thing I did was to access his website and all I could see was a simple blank page. I rang him up again to get his control panel password. I logged into his website's control panel. It took only a few minutes for me to figure out the problem. When I tried to access one of the tables in his database via phpmyadmin, i got this error. Table __________ is marked as crashed and should be repaired.
The solution was right on my face. 'SHOULD BE REPAIRED'. So I used the control panel to see his databases. I chose the one that had this problem and repaired it. Of course there was a 'Repair DB' option provided on the control panel under 'MySQL databases' option. It took only a 3 seconds for the repair to finish successfully.
BINGO. the website was up again. So if you are facing this issue all you have to do is to repair the database in question. Don't panic. In addition take these steps to avoid future panic.
1. Do a regular backup of your databases.
2. Index your tables based on the 'WHERE' clause of your queries.
3. Optimise your SQL queries properly.
Add Comment
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
- Your name, rating, website address, town, country, state and comment will be publicly displayed if entered.
- Aside from the data entered into these form fields, other stored data about your comment will include:
- Your IP address (not displayed)
- The time/date of your submission (displayed)
- Your email address will not be shared. It is collected for only two reasons:
- Administrative purposes, should a need to contact you arise.
- To inform you of new comments, should you subscribe to receive notifications.
- A cookie may be set on your computer. This is used to remember your inputs. It will expire by itself.
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
- Although the administrator will attempt to moderate comments, it is impossible for every comment to have been moderated at any given time.
- You acknowledge that all comments express the views and opinions of the original author and not those of the administrator.
- You agree not to post any material which is knowingly false, obscene, hateful, threatening, harassing or invasive of a person's privacy.
- The administrator has the right to edit, move or remove any comment for any reason and without notice.
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
- Data Science
- Android
- React Native
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Use a dynamic table name in a SQL Server SELECT statement
Finding slow queries in MySQL - Enable slow query log.
mysqldumpslow in MySQL - Summarize slow query log.
Sample my.cnf (my.ini) for MySQL with 1GB RAM
Modify a auto_increment id column in mysql to accept a 5 digit random number instead
Changing the Structure of an Existing Table in MySQL
Inserting Data into Tables in MySQL
Querying the Database in MySQL
Comments