MySQL common error code, causes and handling methods

Source: Internet
Author: User

Error code: 1045

Error message:

Access denied for user ' username ' @ ' password ' (using Password:yes)

Error Reason: Permission error, Access Forbidden

Error handling:

1 ) using the correct user name and password, or

2 After modifying permissions, flush privileges

Error code: 1036

Error message:

Table ' xxx ' is read only .

Cause of error: mistakenly moving MySQL table or other files

Error handling:

Check the table file (. frm,. IBD,. MYD,. MYI) permissions

Set Table file owner and Execute permissions are: MySQL 660

Restart Service

Error code: 1030 (28)

Error message:

Got Error - From storage Engine

Error reason: Insufficient disk temporary space

Error handling:

Empty the system Temp file directory/tmp, or

my.cnf Point Tmpdir to the large space directory

Error code: 1030 (-1)

Error message:

Got Error -1 From storage Engine

Cause of error: Insufficient disk space or Innodb_force_recovery parameter greater than 0

Error handling:

Check disk space, insufficient to enlarge, or

Check that the value of Innodb_force_recovery in the my.cnf file is greater than 0. If it is greater then the service is restarted after modification.

Error code: 1050

Error message: Table ' xxxx ' already exists

Cause of Error:

Table already exists

After physical migration, the frm file of the table is not deleted correctly (or the frm file of the table after the drop is still present)

Error handling (second case):

Manually delete a table frm file

Restart Service

Error code: 1062

Error message:

Duplicate Entry ' Key ' For key ' PRIMARY '

Cause of Error: duplicate primary key

Error result: Master-slave replication fractured (SQL thread fractured), unable to write

Error handling:

The write occurs when the self-increment key determines whether to increase the value of the self-increment key. such as the largest 11-bit integer of type int, when the table increment exceeds the maximum value, the last key value is always not the maximum value. Or

If the self-increment key does not reach the maximum value, the write error may be applied. When the data consistency requirement is not high, you can choose to skip the error; When the data consistency requirement is high, the self-increment key can be removed and reinserted. When the processing is complete, ask the relevant person to verify the cause of the error. Or

The master-slave replication scenario requires checking for dirty data from the library.

Error code: 1032

Error message:

Handler Error Ha_err_key_not_found

Error reason: Master-slave data inconsistency (for a number of reasons)

Error result: Master-slave replication fractured (SQL thread fractured), unable to write

Error handling:

If the data consistency requirement is not high, skip the error, or

Use tools to fix inconsistent data, or

Re-master from replication

Error code: 1205

Error message:

Lock Wait timeout exceeded

Cause of error: Large transaction uncommitted on main library, resulting in subsequent transaction lock wait timeout, synchronization to lock waiting timeout from library.

Error result: Master-slave replication disconnects

Error handling:

Main Library my.cnf parameter setting innodb_rollback_on_timeout=1, transaction time-out rollback

Ignore the 1205 error from the library, or

Show processlist View SQL with a long execution time and kill

Error code: 2013

Error message:

Error reading packet from Server:lost connection to MySQL server during query

Cause of error: Reverse parsing, Max_allowed_packet master-slave Inconsistency, network problem

Error result: Master-slave replication disconnects

Error handling:

Reverse resolution Skip-name-resolve is disabled in master Profile MY.CNF, or

The master/Slave profile my.cnf Max_allowed_packet set to the same value and restart the service, or

Adjust the value of Net_write_timeout in master profile MY.CNF, or other network cause

This article is from the "it--Brother" blog, please make sure to keep this source http://402753795.blog.51cto.com/10788998/1729369

MySQL common error code, causes and handling methods

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.