Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common error codes in MySQL

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "what are the common error codes in MySQL". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First of all, I will show you some examples of error analysis and solutions.

1.ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/ data/mysql/mysql.sock'

Problem analysis: it may be that the database is not started or the port is prohibited by the firewall.

Solution: start the database or firewall to open the database listening port.

2.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Problem analysis: incorrect password or no permission to access.

Solution:

1) modify the my.cnf main configuration file, add skip-grant-tables under "mysqld", and restart the database. The final command to change the password is as follows:

Mysql > use mysql; mysql > update user set passwordpassword=password ("123456") where user= "root"

Delete the skip-grant-tables parameter you just added, restart the database, and log in with the new password.

2) re-authorize, with the following command:

Mysql > grant all on *. * to 'root'@'mysql-server' identified by' 123456'

3. Client reports Too many connections

Problem analysis: the number of connections exceeds the maximum connection limit of Mysql.

Solution:

1. Increase the number of connections in the my.cnf configuration file, and then restart the MySQL service. Max_connections = 10000

2. Temporarily modify the maximum number of connections, which will not take effect after restart. You need to modify the configuration file in my.cnf, and the next restart will take effect.

Set GLOBAL max_connections=10000

4.Warning: World-writable config file'/ etc/my.cnf' is ignored ERROR! MySQL is running but PID file could not be found

Problem analysis: the configuration file / etc/my.cnf permissions of MySQL are incorrect.

Solution:

Chmod 644 / et/my.cnf

5.InnoDB: Error: page 14178 log sequence number 29455369832 InnoDB: is in the future! Current system log sequence number 29455369832

Problem analysis: innodb data file is corrupted.

Solution: modify the my.cnf configuration file, add innodb_force_recovery=4 under [mysqld], back up the data file after starting the database, then remove the parameter and use the backup file to restore the data.

6. From Slave_IO_Running to NO of the library

Problem analysis: the server-id value of master library is the same as that of slave library.

Solution: modify the value of the server-id of the slave library to be different from the master library and lower than the master library. Restart after modification, and then synchronize!

7. From Slave_IO_Running of library to NO problem

Problem analysis: there are many reasons why the slave thread is NO. The main reason is that the primary key conflicts or the master database deletes or updates the data, the record cannot be found from the library, and the data is modified. Usually, there are 1007, 1032, 1062, 1452 and so on.

Solution 1:

Mysql > stop slave; mysql > set GLOBAL SQL_SLAVE_SKIP_COUNTER=1; mysql > start slave

Solution 2: set user permissions and set read-only permissions from the library

Set global read_only=true

8.Error initializing relay log position: I/O error reading the header from the binary log

Analyze the problem: the relay log relay-bin of the slave library is corrupted.

Solution: fix it manually, re-find the synchronized binlog and pos points, and then resynchronize.

Mysql > CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.xxx',MASTER_LOG_POS=xxx

Operators or DBA who have maintained MySQL know that there are some 10xx-like codes in some of the error messages that you often encounter.

Replicate_Wild_Ignore_Table: Last_Errno: 1032 Last_Error: Could not execute Update_rows event on table xuanzhi.test; Can't find record in 'test', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000004, end_log_pos 3704

However, if you don't delve into it or have encountered it before, it's not clear what exactly this code means. This also caused some hindrance to our wrong arrangement.

Therefore, today, migrant workers will sort out some common error codes in the process of master-slave synchronization.

MySQL common error code description:

130: the file format is incorrect.

145: the file cannot be opened

1005: failed to create table

1006: failed to create database

1007: database already exists, failed to create database

1008: database does not exist, failed to delete database

1009: failure to delete database due to failure to delete database file

1010: failure to delete database due to failure to delete data directory

1011: failed to delete database file

1012: unable to read records in system table

1020: the record has been modified by another user

1021: there is not enough space left on the hard disk. Please increase the available space on the hard disk.

1022: duplicate keyword, failed to change record

1023: error occurred during shutdown

1024: read file error

1025: error occurred while changing name

1026: file write error

1032: record does not exist

1036: the datasheet is read-only and cannot be modified

1037: the system is out of memory, please restart the database or restart the server

1038: insufficient memory for sorting, please increase the sort buffer

1040: the maximum number of connections to the database has been reached. Please increase the number of available connections to the database.

1041: out of system memory

1042: invalid hostname

1043: invalid connection

1044: the current user does not have access to the database

1045: unable to connect to the database, wrong username or password

1048: field cannot be empty

1049: database does not exist

1050: datasheet already exists

1051: datasheet does not exist

1054: field does not exist

1065: invalid SQL statement, SQL statement is empty

1081: Socket connection cannot be established

1114: the datasheet is full and cannot hold any records

1116: too many data tables are open

1129: there is an exception in the database. Restart the database.

1130: failed to connect to the database, do not have permission to connect to the database

1133: database user does not exist

1141: the current user does not have access to the database

1142: the current user does not have access to the data table

1143: the current user does not have access to fields in the data table

1146: datasheet does not exist

1147: no user access to the datasheet is defined

Syntax error of 1149:SQL statement

1158: network error, read error, please check the network connection status

1159: network error, read timeout, please check the network connection status

1160: network error, write error, please check the network connection status

1161: network error, write timeout, please check the network connection status

1062: duplicate field value, failed to enter the database

1169: duplicate field value, failed to update record

1177: failed to open datasheet

1180: failed to commit transaction

1181: failed to roll back the transaction

1203: the maximum number of connections between the current user and the database has reached the database. Please increase the number of available database connections or restart the database.

1205: lock timeout

1211: the current user does not have permission to create a user

1216: failed to check foreign key constraints and update child table records

1217: foreign key constraint check failed, delete or modify master table record failed

1226: the current user has used more resources than allowed, please restart the database or restart the server

1227: insufficient permissions, you are not authorized to perform this operation

The 1235:MySQL version is too low to have this feature.

1250: the client does not support the authentication protocol required by the server, please consider upgrading the client.

1251:Client cannot support the requirement of authentication protocol Client does not support authentication protocol requested by server; consider upgrading MySQL clientQuote:

1267: illegal mixed character set.

2002: the server port is incorrect.

The 2003:MySQL service is not started. Please start the service.

The 2008:MySQL client ran out of memory error points to the MySQL customer mysql. The reason for this error is simple: the customer does not have enough memory to store all the results.

2013: this problem sometimes occurs when connecting to a database remotely, when the MySQL server loses the connection while executing a SQL statement.

10048: it is recommended to modify the maximum number of connections in the my.ini file and change the mysql_connect () method to the mysql_pconnect () method. To modify mysql_pconnect (), you can change whether pconnect=0;// persists for a long time in the sql_config.php of the data directory of the forum to change it to pconnect=0;// persistent connection to pconnect=0;// persistent connection to pconnect= 1. Enable anti-refresh, and do not refresh too quickly.

10055: there is no cache space available. Check to see if your C disk is full and clear some useless files. Can be in the background "Forum Core Settings", "Core function Settings" in "process Optimization" on, "GZIP Compression output" off. Looked up 10055 (no cache space available)

10061: start the MySQL service on this machine. If the service fails to start, there must be something wrong with your my.ini file. The MySQL service cannot start normally. After you delete it, MySQL will run according to its default configuration. There will be no problem.

This is the end of the content of "what are the common error codes in MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report