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 27-02-2010
Member
 
Join Date: Feb 2010
Posts: 119
How to detect failure of MySQL database tables

Hi everybody,

I am using MySQL database, it have lots of process, a variety of accident Database Table damage, and these data are often the latest data, and can not be found in the backup data. Si i want to know that how to detect failure of MySQL database tables. Please suggest. Thanks in advance.
Reply With Quote
  #2  
Old 27-02-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
How to detect failure of MySQL database tables

Table Fault Detection and amendment of the general process is as follows:

# Check the error table. If the table check is passed, then complete the task, he must repair the error database table.
# Begin repairing the table before copying the file to ensure data security.
# Begin the restoration of the database table.
# If the repair fails, the backup from the database or update Log to recover the data.
Reply With Quote
  #3  
Old 27-02-2010
Member
 
Join Date: May 2008
Posts: 2,008
Re: How to detect failure of MySQL database tables

You need to establishment of a database backup and use the updated log, to prevent repair failure, loss of data. If you are on the Unix platform, table maintenance, it should first registered to a dedicated account for mysql, in order to avoid the table to read and write access to create ownership, as well as destruction of the database directory all the permissions. All the best.
Reply With Quote
  #4  
Old 27-02-2010
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: How to detect failure of MySQL database tables

MySQL myisanchk and isamchk utility is very similar, basically they have the same use of Methods. The main difference between them when used in the table type. In order to check / repair MyISAM tables (. MYI, and. MYD), you should use the myisamchk utility. In order to check / repair ISAM tables (. ISM and. ISD), you should use the isamchk utility. In order to use either one to use the program, should indicate you want to check or repair tables, myisamchk, and isamchk used methods are:
Code:
shell> myisamchk options tbl_name
shell> isamchk options tbl_name
Reply With Quote
  #5  
Old 27-02-2010
Member
 
Join Date: May 2008
Posts: 2,293
Re: How to detect failure of MySQL database tables

You can also specify a name as an index file (with ". MYI" or ". ISM" suffix), which allows you to use pattern "*. MYI" or ". ISM" to specify a directory all of the tables. For example, if you are in a database directory, you can check the directory so that all of the table:
Code:
shell> myisamchk *. MYI
shell> isamchk *. ISM
If you are not in the database directory, you can specify the directory path:
Code:
shell> myisamchk options / path / to / database_dir / *. MYI
shell> isamchk options / path / to / database_dir / *. ISM
Check and reply.
Reply With Quote
  #6  
Old 27-02-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
How to detect failure of MySQL database tables

You can even use for the MySQL data directory path to specify a wildcard to act on all of the database all the tables:
Code:
shell> myisamchk options / path / to / datadir /*/*. MYI
shell> isamchk options / path / to / database_dir /*/*. ISM
This method can not be used in the windows platform. Note that both myisamchk or isamchk the location of the table do not make any judgments, therefore, should be the file or the directory that contains the table run the program, or specify the path name of the table. This allows you to copy the table files to another directory and use the copy instructions. Best of luck.
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 detect failure of MySQL database tables"
Thread Thread Starter Forum Replies Last Post
MySQL: Entering data in tables Botan Software Development 2 22-12-2010 05:44 AM
How to manage databases and tables in MySQL? Aahlaadith Software Development 5 17-12-2010 07:18 AM
How to create MySQL Database and Tables in PHP? Orton Software Development 4 23-02-2010 06:45 AM
Mysql select from multiple tables for php. afidelino Software Development 4 09-07-2009 06:13 PM
Restore corrupted MyISAM/InnoDB tables on MySQL 5.0 jean-paul martell Software Development 5 14-04-2009 09:03 AM


All times are GMT +5.5. The time now is 06:23 AM.