Mysql error code and solution _ MySQL

Source: Internet
Author: User
Mysql error code and solutions common solutions for database errors!
Here is a solution for MySQL Query Error prompts. some of them can be solved by yourself. it is not necessary to ask questions over and over again. Unless it is a conventional method that cannot be solved ~
The following are common database error messages when installing plug-ins:

CODE: Duplicate column name 'allowrank'
Occasionally, this indicates that the table already exists. However, if the installation is performed, the following steps are not affected. If this problem occurs during the compilation of the plug-in, change the table name.
CODE: Error: Duplicate entry 'aa2hv2' for key 1
Errno.: 1062
Generally, the key value is repeatedly input, resulting in repeated errors. you can create a new table to solve this problem.

CODE: Error: Unknown system variable 'names'
Errno.: 1193
It is easy to import data. Open an SQL file
1. delete set names 'gbk'
2. find ENGINE = myisam default charset = gbk and replace it with: TYPE = MYISAM.
3. find ENGINE = heap default charset = gbk and replace it with TYPE = HEAP.
4. delete character set gbk collate gbk_bin.
5. restore the instance.

CODE: Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'default CHARSET = gbk' at line 1
Errno.: 1064
Generally, the encoding does not match. open the installation file and see the database upgrade code. you can delete the file with 'default CHARSET = gbk.

CODE: Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near's XXXXX
Errno.: 1064
This is a tough issue. generally, database code is written in different types. for example, if you write Chinese characters at a floating point, you can check your settings to check whether the numbers are written in English or Chinese. If any problem occurs during the compilation of the plug-in, check the correctness of the database syntax.
For data import, you can use restore. php to import data.

CODE: Error: Unknown column 'FF. threadperms 'in 'Field list'
This is the best solution. Generally, the prompt "Unknown column" is displayed, indicating that your data table is missing this table. you can create it manually.

CODE: Error: Access denied for user: 'unknown _ USER @ localhost' (Using password: YES)
I don't know what to say about this problem ~ It is still unclear if the database password user has entered an error. contact the space provider.

CODE: Can't DROP 'aaaallowrank '; check that column/key exists
This is usually caused by reverse installation, indicating that the table does not exist. In fact, there is no problem. if it does not exist, there is no need to install it.

CODE: Error: Illegal mix of collations (latin1_swedish_ci, IMPLICIT) and (gbk_chinese_ci, COERCIBLE) for operation '='
Errno.: 1267
If the character set of the database is invalid, modify the character set of the data table in PHPMYADMIN.
CODE: Discuz! Info: MySQL Query Error
User: admin
Time: pm
Script:/bbs2/index. php
SQL: DELETE FROM cdb_subscriptions WHERE lastpost <'201312'-1145421168
Error: Unknown column 'lastpost' in 'where clause'
Errno: 1054
An error report has been dispatched to our administrator.

Cause: The lastpost field is missing in the subscriptions table.
Solution: in phpMyAdmin or DZ Forum background, "upgrade database", enter the following statement:

Alter table cdb_subscriptions ADD lastpost int (10) unsigned not null default '0' AFTER tid;
CODE: connection error message 1251:
#1251-Client does not support authentication protocol requested by server; consider upgrading MySQL client
Solution:
Mysql> UPDATE mysql. user SET Password = OLD_PASSWORD ('password') WHERE Host = 'localhost (Host name) or IP' AND User = 'database username ';
Mysql> flush privileges;
Mysql> use mysql
Mysql> update user set password = old_password ('cnscn ');
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: mysql

Query OK, 5 rows affected (0.01 sec)
Rows matched: 5 Changed: 5 Warnings: 0

Mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

CODE: Discuz! Info: MySQL Query Error

User: imoker
Time: pm
Script:/bbs/viewthread. php

SQL: SELECT expiration, keywords, relatedthreads FROM cdb_relatedthreads WHERE tid = '123'
Error: Can't find file: 'cdb _ relatedthreads. myi' (errno: 2)
Errno.: 1017
Similar error report has beed dispatched to administrator before.

Error analysis: the server is shut down illegally, which may affect some databases.

An error is reported during normal operation.
**. MYD cannot be enabled.
Can't find file: '***. myi'

Solution: Use the repair. php file in the utilities directory in the compressed forum package you downloaded to fix it.
Method: Upload repair. php to the root directory of the Forum and run it in the browser.
Http: // your forum address/repair. php
Generally, click the first link "repair. php? Html = 1 & check = 1 "to fix it,
If it cannot be repaired, click the second connection "repair. php? Check = 1 & iterations = 5"

You can.

Tip: After you fix the table, remember to delete the repair. php file from the server.
My own sorting, updated on April 9, October 17. if you have any additional information, let's explain it. 1005: An error occurred while creating the table.
1006: database creation failed
1007: The database already exists. An error occurred while creating the database.
1008: The database does not exist. An error occurred while deleting the database.
1009: the database file cannot be deleted, leading to database deletion failure.
1010: failed to delete database because the data directory cannot be deleted
1011: An error occurred while deleting the database file.
1012: records in the system table cannot be read.
1020: The record has been modified by another user
1021: the remaining space on the hard disk is insufficient. Please increase the available space on the hard disk.
1022: duplicate keywords. failed to change the record
1023: An error occurred while disabling the service.
1024: An error occurred while reading the file.
1025: An error occurred while changing the name
1026: File write error
1032: The record does not exist
1036: the data table is read-only and cannot be modified.
1037: the system memory is insufficient. restart the database or restart the server.
1038: the memory used for sorting is insufficient. increase the sorting buffer.
1040: maximum number of connections to the database. increase the number of available connections to the database.
1041: insufficient system memory
1042: invalid host name
1043: invalid connection
1044: the current user is not authorized to access the database
1045: The database cannot be connected. the user name or password is incorrect.
1048: the field cannot be blank
1049: The database does not exist.
1050: the data table already exists.
1051: the data table does not exist.
1054: the field does not exist.
1065: invalid SQL statement. The SQL statement is empty.
1081: cannot establish Socket connection
1114: the data table is full and cannot accommodate any Records
1116: too many open data tables
1129: database exception. restart the database.
1130: failed to connect to the database. you are not authorized to connect to the database.
1133: The database user does not exist
1141: the current user is not authorized to access the database
1142: the current user is not authorized to access the data table
1143: the current user is not authorized to access fields in the data table.
1146: the data table does not exist.
1147: the user's access permission to the data table is not defined.
1149: SQL statement syntax error
1158: Network Error. read error. check the network connection status.
1159: Network Error. Read Timeout. check the network connection status.
1160: Network Error. a write error occurs. check the network connection status.
1161: Network Error. write timeout. check the network connection status.
1062: The field value is repeated and the database import fails.
1169: The field value is repeated and the update record fails.
1177: An error occurred while opening the data table.
1180: transaction submission failed
1181: transaction rollback failed
1203: the maximum number of connections established between the current user and the database to reach the database. increase the number of available database connections or restart the database.
1205: Lock Timeout
1211: the current user does not have the permission to create a user
1216: failed to check foreign key constraints and failed to update sub-table records
1217: failed to check foreign key constraints, failed to delete or modify the primary table record
1226: the resource used by the current user has exceeded the allowed Resource. please restart the database or the server.
1227: You are not authorized to perform this operation.
1235: MySQL version is too low and does not have this function

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.