2022-10-27 359
先给大家看几个实例的错误分析与解决方案。
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>usemysql; mysql>updateusersetpassword=password("123456")whereuser="root";
再删除刚刚添加的 skip-grant-tables 参数,再重启数据库,使用新密码即可登录。
2)重新授权,命令如下:
mysql>grantallon*.*to'root'@'mysql-server'identifiedby'123456';
3.客户端报 Too many connections
问题分析:连接数超出 Mysql 的最大连接限制。
解决方法:
setGLOBALmax_connections=10000;
4.Warning: World-writable config file ‘/etc/my.cnf’ is ignored ERROR! MySQL is running but PID file could not be found
chmod644/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问题
问题分析:造成从库线程为 NO 的原因会有很多,主要原因是主键冲突或者主库删除或更新数据, 从库找不到记录,数据被修改导致。通常状态码报错有 1007、1032、1062、1452 等。
解决方法一:
mysql>stopslave; mysql>setGLOBALSQL_SLAVE_SKIP_COUNTER=1; mysql>startslave;
解决方法二:设置用户权限,设置从库只读权限
setglobalread_only=true;
8.Error initializing relay log position: I/O error reading the header from the binary log
mysql>CHANGEMASTERTOMASTER_LOG_FILE='mysql-bin.xxx',MASTER_LOG_POS=xxx;
维护过MySQL的运维或DBA都知道,经常会遇到的一些错误信息中有一些类似10xx的代码。
Replicate_Wild_Ignore_Table: Last_Errno:1032 Last_Error:CouldnotexecuteUpdate_rowseventontablexuanzhi.test;Can'tfindrecordin'test',Error_code:1032;handlererrorHA_ERR_KEY_NOT_FOUND;theevent'smasterlogmysql-bin.000004,end_log_pos3704
但是,如果不深究或者之前遇到过,还真不太清楚,这些代码具体的含义是什么?这也给我们排错造成了一定的阻碍。
所以,今天民工哥就把主从同步过程中一些常见的错误代码,它的具体说明给大家整理出来了。
MySQL常见错误代码说明:
原文链接:https://77isp.com/post/10167.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态