Results 1 to 4 of 4

Thread: How to repair MySQL table?

  1. #1
    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.

  2. #2
    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.

  3. #3
    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.

  4. #4
    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).

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

    myisamchk *.MYI

Similar Threads

  1. What are the Table Types in MySQL?
    By Dino M in forum Software Development
    Replies: 7
    Last Post: 29-10-2010, 05:18 PM
  2. Structure of Table in MySQL
    By Eleeazar in forum Software Development
    Replies: 4
    Last Post: 06-11-2009, 10:57 PM
  3. How to select multiple table in MySql
    By Doroteo in forum Software Development
    Replies: 4
    Last Post: 05-11-2009, 09:28 PM
  4. How to Insert data into MySQL table
    By Mahendra varma in forum Software Development
    Replies: 4
    Last Post: 04-10-2009, 04:42 AM
  5. About mysql table subqueries
    By Benito in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 06:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,270,573.35530 seconds with 17 queries