Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 05-09-2009
Member
 
Join Date: Apr 2009
Posts: 68
How to repair MySQL table?

I am testing for the data inserted into my table content, I have tried out several ways to do it with the query REPAIR TABLE tablename, QUICK and EXTENDED, I thought these command will easily repair that table but I dont know what was the reason this is not happening. How should I do that.
Reply With Quote
  #2  
Old 05-09-2009
Member
 
Join Date: Feb 2009
Posts: 105
Re: How to repair MySQL table?

If a MySQL table becomes corrupt, you need to repair it. The repair process involves up to four stages. Select a database from the drop down menu on the left. A list of tables in that db will appear directly below the drop down menu. Before you begin, you should change location to the database directory and check the permissions of the table files. You can use the repair.php script that you need to download from the internet. Note that repairing a corrupt MySQL table may lead to loss of data. It's therefore important to create a backup of your system.
Reply With Quote
  #3  
Old 05-09-2009
Member
 
Join Date: Dec 2008
Posts: 161
Re: How to repair MySQL table?

If you are going to repair a table from the command line, you must first stop the mysqld server. Normally you should never have to run the REPAIR TABLE command, but if disaster strikes, you are very likely to get back all your data from a MyISAM table with it Note that when you do mysqladmin shutdown on a remote server, the mysqld server is still alive for a while after mysqladmin returns, until all statement-processing has stopped and all index changes have been flushed to disk.
Reply With Quote
  #4  
Old 05-09-2009
Member
 
Join Date: Mar 2008
Posts: 258
Re: How to repair MySQL table?

If you don't have a ccess to the MySQL prompt, but can access the shell, you can use the myisamchk utility. In the right part of the SQLyog window, click on the Query tab. A standard alone PHP script can be executed directly with the PHP Command Line Interface (CLI). Enter REPAIR TABLE tablename, for example, REPAIR TABLE hm_messages. Click on the Execute Current Query button in the toolbar (or select Edit->Execute Query->Execute current query or press F5).

Quote:
cd /var/lib/mysql/DBNAME
#^ Please note that we assume your mySQL data directory is /var/lib/mysql

myisamchk *.MYI
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to repair MySQL table?"
Thread Thread Starter Forum Replies Last Post
What are the Table Types in MySQL? Dino M Software Development 7 29-10-2010 05:18 PM
Structure of Table in MySQL Eleeazar Software Development 4 06-11-2009 10:57 PM
How to select multiple table in MySql Doroteo Software Development 4 05-11-2009 09:28 PM
How to Insert data into MySQL table Mahendra varma Software Development 4 04-10-2009 04:42 AM
About mysql table subqueries Benito Software Development 2 04-08-2009 06:07 PM


All times are GMT +5.5. The time now is 04:33 PM.