点击上方“民工哥技术之路”,选择“设为星标”
回复“1024”获取独家整理的学习资料!
先给大家看几个实例的错误分析与解决方案。
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常见错误代码说明:
130 :文件格式不正确。
145 :文件无法打开
10061: 启动这台机器上的MySQL服务 如服务启动失败,一定是你的my.ini文件出了差错, MySQL服务不能正常启动 你删除了它后,MySQL就会按其默认配置运行, 那就没有问题了
一入职,就遇到 MySQL 这么大 Bug!差点背锅走人...
Linux 日志切割神器 Logrotate 原理和配置详解(附多生产实例)