Custom Search

‘duplicate Unique Key Or Constraint On Write Or Update’ Mysql Error And Recovery

Storage engines (like MyISAM and InnoDB) that are supported by MySQL work as handlers for its various table types. MySQL tables are components used to relate and store data in its databases. But at times, you observe corruption issues with these tables that can occur due to improper locking of tables, unexpected shutdown, application code errors, storage engine faults and other similar reasons. In such cases, you need to use your updated database backup to retrieve lost data. However, if backup seems to be invalid or is not available, you need to repair the damaged table by using MySQL Database Recovery software.

You might encounter the below error message with your MySQL database table:

“141: Duplicate unique key or constraint on write or update”

• In MySQL tables, unique key is the constraint that is responsible for uniquely identifying each row in the table

Cause

The basic reason for the occurrence of this error message is inconsistencies of MySQL database table. It can happen due to unexpected shutdown and other similar causes.

Solution

To solve this issue, you need to follow these steps:

• First, you need to check the affected table for corruption. You can run CHECK TABLE command as follows:

CHECK TABLE tablename

The server must be running for the command to run. You can also use mysqlcheck or myisamchk command-line utility to check MySQL tables.

• If table check reports corruption, you need to repair it. You can use following command:

REPAIR TABLE tablename

mysqlcheck or myisamchk command-line utilities can also be used.

• If you still receive the same error message or the table is inaccessible, you can use your recent data backup to restore the entire database. However, if no backup is available or it gives certain corruption related errors during restoration or is incomplete, third-party MySQL Recovery applications can be used to repair and restore all the lost information.

MySQL Database Recovery tools are special utilities that can scan damaged MySQL databases and restore all their objects. They offer interactive interface together with advanced repair options. With read-only design and uniquely developed scanning algorithms, such MySQL Recovery applications provide complete database recovery.

Stellar Phoenix Database Recovery For MySQL is the premier MySQL Repair tool that can instantly repair and restore corrupt MySQL databases. It supports InnoDB (.ibdata, .ibd and .frm) and MyISAM (.myd, .myi and .frm) files. The software is compatible with MySQL 5.x. It supports recovery from MySQL database installed on Windows as well as Linux platforms. It is compatible with Windows Vista, XP, 2003 and 2000.

By: colindolly

Article Directory: http://www.articledashboard.com

Colin Dolly is a self employed Internet entrepreneur and product reviewer Stellar Phoenix Database Recovery For MySQL is the premier MySQL Repair tool that can instantly repair and restore corrupt MySQL databases. It supports InnoDB (.ibdata, .ibd and .frm) and MyISAM (.myd, .myi and .frm) files.

© 2005-2011 Article Dashboard