Wednesday, February 16, 2011

MySQL recovery utility for any instance of corruption

In order to start your MySQL server, you used to type the whole path like: "C:\mysql\bin\mysql123" in your DOS prompt. However, sometimes, the MySQL server fails to start with this usual command and the reason may be any possible case of database corruption or damage. In such a case, you cannot be able to access your database and need any MySQL repair utility to repair the troubled MySQL database and recover the data thereof.
In case of any corruption, you may encounter an error message at the start of the MySQL server, which may be as below:

"Default storage engine is not available"

Moreover, in order to resolve the error, if you reinstall the MySQL server without removing the data directory, the server starts normally. However, to your utter dismay, while accessing the any database table, you may encounter another error message on the screen as below:

"ERROR 1146 (42S02): Table 'Tablename' doesn't exist"

Note: Here, the 'Tablename' is the name of the table, you have tried to access.

The above error message appears each time you try to access the table. Even, you cannot be able to resolve the error with the 'mysqlcheck' utility.

In general, the reason behind the occurrence of the error messages is the corruption of the MySQL database, which can have been caused due to an improper system shut down, virus/malware intrusion or any other application malfunction etc.

Resolution:

In order to resolve the problem, you need to repair MySQL with the following command:

Repair Table Tablename
However, with severe corruption, the above command does not able to repair the database and you need to look for any valid backup to restore your seemingly lost MySQL database. If you fail to restore the database from the backup, then, you need to run any MySQL recovery software to recover back the database efficiently.

These read-only utilities are designed with advanced algorithms to repair MySQL database and recover the data safely. Moreover, with highly interactive graphical user interface, you may never find any problem in operating the software.

Stellar Phoenix Database Recovery For MySQL is an extremely powerful utility to repair the corrupt database and recover MySQL database with all its internal structure being intact. The software works well with almost all Windows versions, including Windows Vista, XP, 2003, 2000 and is absolutely easy to use on the parts of experts to normal users.

Sunday, February 6, 2011

Advanced Utility to Repair and Restore Corrupt MySQL Table

MySQL database has many commands to systematically maintain its data. All of these commands have different syntax. Out of the several commands, MySQL database has two most common commands that are Optimize and Flush. The Optimize command of MySQL database is used for the defragmenting the database files and use the free space. The Flush command of MySQL database reloads and clears all the internal patches used by database. You can use Flush statement with RELOAD privilege. The above mentioned two commands have different functionalities and features. Using MySQL commands one after the another, your MySQL database table can get corrupted. In such scenarios, your data saved in the table will be inaccessible. For accessibility of table data, you should use an advanced MySQL repair software to fix the problem.

Consider a practical scenario wherein, you run the Optimize command and consequently run the Flush command, after doing this you may got an error message and the data stored in the mysql table become inaccessible.

Root Cause of Problem:

The main cause of the MySQL table corruption is you have used Optimize and Flush command concurrently.

Way to Resolve:

The safe and effective way to repair MySQL table is to run the given below command.

Check corruption limit of mysql table using given statement:
mysqlcheck [options] dbname tablename [tablename2... ]
Repair damaged table using given below statement:
repair table tablename [,tablename1...][options]

The above mentioned steps enable you to repair the mysql database table and fix the problem. But if, these steps fail to fix the corruption issue, that means table is not repair by the command. In such scenarios, you can used the backup of your database for restoring the table. If in case, backup is not updated then only way to repair your corrupt table is by using a third party MySQL Recovery Repair software.

These third party MySQL recovery software used advanced algorithm to repair the corrupted MySQL table. With highly graphical user-documentation, the software is self explanatory and does not require any technical understanding.

Monday, January 17, 2011

Recover Crashed Tables in MySQL Database

MySQL is a popular database management system, a most widely used for web databases, offers efficient techniques to ensure absolute integrity of the database. When you start MySQLD (MySQL Server), it automatically examines all the database tables for integrity. MySQL Server also fixes the tables if they are marked as ´not closed properly´ or ´crashed´. It backs up all the corrupted database tables and makes their entries in the error log. Though, it works in a number of cases, but cannot necessarily fix all the corruption issues and fails to recover MySQL database.

The MySQLD technique cannot repair MySQL database if it is severely damaged. As a practical scenario, where MySQL Server cannot handle the table corruption, you may encounter the below error message-

"Got an error from thread_id=1, mi_dynrec.c:368"

The above error message occurs when you start the MySQL server for accessing the database records that are stored in the MyISAM (MySQL database engine). After initialization, the server examines for integrity of all database tables and attempts to repair the damaged ones. MySQL Server logs this error in error log.

This problem occurs every time you start MySQL Server database, until you repair or remove the damaged tables. All the records that you have saved in MyISAM table become unusable after this error.

Root of the problem:


There are numerous reasons of MySQL database corruption, such as virus infection, unexpected system shutdown, application malfunction, and subsequent editing of the database. MySQL server cannot recognize the database after corruption and thus you face this problem.

Solution:

In order to perform MySQL database recovery in such situations, follow the underwritten steps-

Check the extent of damage to the table using the CHECK TABLE command. Once the corrupt table is identified, use REPAIR TABLE command to repair MySQL database table.

If you have an updated and valid backup of the damaged table, restore it. Backup is the best way to perform MySQL recovery.

In case you do not have a proper backup of your database, you are required to look for alternative MySQL repair solution, which is to use MySQL database recovery software.

MySQL recovery software are particularly designed to repair MySQL database with highly-advanced scanning techniques. They safely repair MySQL database with read-only and non-destructive conduct.

Stellar Phoenix Database Recovery for MySQL is the comprehensive SQL database recovery software that works in all corruption scenarios, with both MyISAM and InnoDB storage engines.

Thursday, December 30, 2010

How to repair MySQL database when the Error 145 occurs

In MySQL databases, the MyISAM table is the default database engine, which provides a variety of functions to manage fields and indexes. These tables are best used for table locking, which makes it very useful while performing real-time transactions on the websites. However, when these tables get corrupt due to any random reason it makes the trading done on the web very insecure. In such cases, you should try to repair MySQL table using some appropriate methods. If none of the methods succeed, then I would recommend you to use a third-party MySQL Repair software to repair MySQL database.

Taking a practical case into consideration in which the following error message is displayed while you are working on a MyISAM table in the MySQL database:

"MySQL error code 145 = Table was marked as crashed and should be repaired"

Cause:
The root cause of this problem is that the MyISAM table has corrupted as there is no more space in it to hold more data.

Resolution:

To overcome this MyISAM table corruption, you need to perform MySQL repair. For this, you should perform the following steps:

Create a backup copy of the database in case something goes wrong during the MySQL recovery.
Stop the mysqld server by killing the process in the Task Manager.
Run the following command to repair the index file to perform quick MySQL recovery:
myisamchk -r -q
If that does not work, then try the following command to perform a detailed scan and repair, if any, of the MyISAM table.
myisamchk --safe-recover
if the previous method also fails, then create a new blank database using the following commands:
shell> mysql db_name
mysql> SET autocommit=1;
mysql> TRUNCATE TABLE tbl_name;
mysql> quit
copy the contents of problem database in the new one.
Restart the mysqld server to check if the problem has been resolved or not.

If the problem is still not resolved, then you must use a third-party MySQL repair software to repair MySQL database. The key features of these MySQL recovery tools are the use of powerful but safe scanning algorithms in a user friendly interface thereby ensuring safe and easy recovery of MySQL database.

The best MySQL repair software that I would suggest you in this case is Stellar Phoenix Database Recovery for MySQL, which repairs MySQL files created in MySQL 3.x, 4.x, 5.x, and 6.x versions. With the ability to recover MySQL components such as tables, views, primary keys, etc, this MySQL recovery tool supports both InnoDB and MyISAM database engines. It is compatible with Windows 7, Vista, Server 2003, XP, and 2000.
Article Source: http://www.articlesbase.com/data-recovery-articles/how-to-repair-mysql-database-when-the-error-145-occurs-3888843.html

About the Author

My name is Mark Willium, I have done Ph.D in computer science and currently doing research on how to repair mysql database.

Thursday, December 23, 2010

How to repair MyISAM tables in MySQL 5.0

MyISAM is the default storage engine in MySQL server. It consists of three types of files: .myi, .frm, and .myd. Of these three, the MYI file is the index file that stores a counter in its header. This header is used to signify whether a particular table was closed properly or not. Sometimes, while using the myisamchk command if you get an error message that means the table has corrupted. Such problems can occur due to various reasons such as power outages, abrupt system shutdown, mysqld process getting killed in between a write operation, etc. You should use in-built workarounds to repair the table. If you are not able to do this, then you should use a third-party MySQL repair software to recover MySQL database.

Consider a scenario wherein you have installed MySQL 5.0 in your system. One day, when you try to run the myisamcheck command to check a database table, it fails to run. An error message is displayed, that is:

“clients are using or haven't closed the table properly”

Cause:

The root cause of this error could be either of the following reasons:

You copied a MyISAM table without using the Lock Table or Flush Tables command.
MySQL crashed while you were about to commit a change in the database table.
Either myisamchk --recover or myisamchk –update-state updated a table while it is used by the mysqld process.
Many mysqld servers are referring to the same table at the same time and one of them performed Repair Table or Check Table command.

For details how to overcome from above error click here

Tuesday, December 14, 2010

Repair your Corrupted MySQL Database

Yesterday one of our computer’s user partition filled up automatically that caused database corruption in the mysql database. After freeing the space from the partition, we ran some commands to repair and recover mysql database. Here is the list what we did yesterday:

1.cd into your directory where your database files are stored. In my case it was in the /usr…/data/mysql/ folder.

2.Then We run this command:
myisamchk *.MYI | grep -3 –color corrupted

3.After running above command this should give you some output on the current state of your database files & indicate which file is corrupted and need to repair. This also gives you the next command to run on the line that is:
Fix it using switch “-r” or “-o”

4.So that is we did
myisamchk -r file.MYI

5.Your database should be repaired

Thursday, December 9, 2010

Recovering MySQL Corruption in Bugzilla Database

Bugzilla is a web-based bug tracking and testing application that is used by many software development companies. It extensively various databases including MySQL for its backend support especially because both of these applications are freely available. Although this tool runs pretty fine in most cases, it can get stalled when the some of the MySQL tables get corrupt. In such cases, you are unable to perform various tasks on the database. You can use the 'myisamchk' command with different parameters to repair MySQL database. If it does not work, then you should use a professional MySQL recovery software to recover MySQL database.

Discussing a similar situation in Bugzilla, consider you get the following error message while generating a bugs report:

"undef error - DBD::mysql::db selectrow_array failed: Table 'attach_data' is
marked as crashed and should be repaired [for Statement "SELECT LENGTH(thedata)
FROM attach_data WHERE id =?"] at Bugzilla/Attachment.pm line 344
Bugzilla::Attachment::datasize('Bugzilla::Attachment=HASH(0x9df119c)') called"

Cause:

As can be inferred from the message itself, the 'attach_data' table is corrupt, which is why you are getting this error message in Bugzilla.

Resolution:

To resolve this error message and repair MySQL database, you should perform the following steps:

You should find out all the corrupt tables in the MyISAM database using the following command:

# myisamchk /var/lib/mysql/bugs/*.MYI >> /tmp/myisamchk_log.txt
The /tmp/myisamchk_log.txt file will contain the list of all the checked tables as displayed:
Checking MyISAM file: user_group_map.MYI

Data records: 182 Deleted blocks: 0
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1

Repair the table using the following command:

# myisamchk -r profiles.MYI
You should do a check and repair using the myisamchk command as displayed:

# myisamchk --silent --force --fast --update-state /var/lib/mysql/bugs/*.MYI

The 'myisamchk' tool is competent enough to check and repair the MyISAM table. But some instances have been noticed where the table is not repaired using this tool. On such occasions, the most worthwhile option is to use a third-party software to perform MySQL repair. These MySQL recovery tools guarantee MySQL repair without any damage to the original tables.

One such software is Stellar Phoenix Database Recovery for MySQL, which repairs MySQL files from all instances of logical corruption. Can be used on various Windows platforms including Windows 7, Vista, Server 2003, XP, and 2000, this MySQL recovery utility recovers MySQL tables created in MySQL 3.x, 4.x, 5.x, and 6.x versions.

Source: http://goarticles.com/article/Recovering-MySQL-Corruption-in-Bugzilla-Database/3759302