mysql常见错误怎么办(建议收藏备查MySQL常见错误代码说明)(1)

先给大家看几个实例的错误分析与解决方案。

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

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

1)修改 my.cnf 主配置文件,在[mysqld]下添加 skip-grant-tables,重启数据库。最后修改密码命令如下:

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

再删除刚刚添加的 skip-grant-tables 参数,再重启数据库,使用新密码即可登录。

2)重新授权,命令如下:

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

3.客户端报 Too many connections

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

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

6.从库的 Slave_IO_Running 为 NO

7.从库的 Slave_IO_Running 为 NO问题

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

set global read_only=true;

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

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

维护过MySQL的运维或DBA都知道,经常会遇到的一些错误信息中有一些类似10xx的代码。

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

但是,如果不深究或者之前遇到过,还真不太清楚,这些代码具体的含义是什么?这也给我们排错造成了一定的阻碍。

所以,今天民工哥就把主从同步过程中一些常见的错误代码,它的具体说明给大家整理出来了。

MySQL常见错误代码说明:

来源:https://www.tuicool.com/articles/u26FZjI

,