1、出现错误提示、
Slave I/O: error connecting to master 'backup@192.168.1.x:3306' - retry-time: 60 retries: 86400, Error_code: 1045 |
解决方法
从服务器上删除掉所有的二进制日志文件,包括一个数据目录下的master.info文件和hostname-relay-bin开头的文件。
master.info::记录了Mysql主服务器上的日志文件和记录位置、连接的密码。
2、出现错误提示
Error reading packet from server: File '/home/mysql/mysqlLog/log.000001' not found (Errcode: 2) ( server_errno=29) |
解决方案:
由于主服务器运行了一段时间,产生了二进制文件,而slave是从log.000001开始读取的,删除主机二进制文件,包括log.index文件。
3、错误提示如下
Slave SQL: Error 'Table 'xxxx' doesn't exist' on query. Default database: 't591'. Query: 'INSERT INTO `xxxx`(type,post_id,browsenum) SELECT type,post_id,browsenum FROM xxxx WHERE hitdate='20090209'', Error_code: 1146 |
解决方法
由于slave没有此table表,添加这个表,使用slave start 就可以继续同步。
4、错误提示如下
Error 'Duplicate entry '1' for key 1' on query. Default database: 'movivi1'. Query: 'INSERT INTO `v1vid0_user_samename` VALUES(null,1,'123','11','4545','123')'
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 '' at line 1' on query. Default database: 'club'. Query: 'INSERT INTO club.point_process ( GIVEID, GETID, POINT, CREATETIME, DEMO ) VALUES ( 0, 4971112, 5, '2010-12-19 16:29:28',' 1 row in set (0.00 sec) |
Mysql > Slave status\G;
显示:Slave_SQL_Running 为 NO
解决方法:
Mysql > stop slave;
Mysql > set global sql_slave_skip_counter =1 ;
Mysql > start slave;
5、错误提示如下
# show slave status\G;
Master_Log_File: mysql-bin.000029 Read_Master_Log_Pos: 3154083 Relay_Log_File: c7-relay-bin.000178 Relay_Log_Pos: 633 Relay_Master_Log_File: mysql-bin.000025 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: club Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1594 Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Skip_Counter: 0 Exec_Master_Log_Pos: 1010663436 |
这个问题原因是,主数据库突然停止或问题终止,更改了mysql-bin.xxx日志,slave服务器找不到这个文件,需要找到同步的点和日志文件,然后chage master即可。
解决方法:
change master to master_host='211.103.156.198', master_user='同步帐号', master_password='同步密码', master_port=3306, master_log_file='mysql-bin.000025', master_log_pos=1010663436; |
6、错误提示如下
Error 'Unknown column 'qdir' in 'field list'' on query. Default database: 'club'. Query: 'insert into club.question_del (id, pid, ques_name, givepoint, title, subject, subject_pid, createtime, approve, did, status, intime, order_d, endtime,banzhu_uid,banzhu_uname,del_cause,qdir) select id, pid, ques_name, givepoint, title, subject, subject_pid, createtime, approve, did, status, intime, order_d, endtime,'1521859','admin0523','无意义回复',qdir from club.question where id=7330212' 1 row in set (0.00 sec) |
这个错误就说club.question_del 表里面没有qdir这个字段 造成的加上就可以了~!
在主的mysql : 里面查询 Desc club.question_del;
在 错误的从服务器上执行 : alter table question_del add qdir varchar(30) not null;
7、错误提示如下
Slave_IO_Running: NO |
这个错误就是IO 进程没连接上 ,想办法连接上把 把与主的POS 号和文件一定要对,然后重新加载下数据。具体步骤:
slave stop;
change master to master_host='IP地址',master_user='club',master_password='mima ',master_log_file='mysqld-bin.000048',MASTER_LOG_POS=396549485;
注:master_log_file='mysqld-bin.000048',MASTER_LOG_POS=396549485;是从主的上面查出 来的 :show master status\G;
LOAD DATA FROM MASTER;
load data from master;
slave start;
问题解决!
本文出自 “学习要永恒” 博客,请务必保留此出处http://hzcsky.blog.51cto.com/1560073/479476
相关推荐
本文实例讲述了mysql 主从数据不一致,提示: Slave_SQL_Running No 的解决方法。分享给大家供大家参考,具体如下: 在slave服务器上通过如下命令 mysql> show slave status\G; 显示如下情况: Slave_IO_Running: ...
今天在测试mysql是否同步时,检查数据库发现一台MySQL Slave未和主机同步,查看Slave状态: mysql> show slave status\G Slave_IO_Running: Yes Slave_SQL_Running: No Last_Errno: 1062 …. Seconds_Behind_Master:...
- **案例2**:如果从服务器出现 `Slave_SQL_Running:No` 的问题,并且错误日志显示为 “Query partially completed on the master (error on master: 1053) and was aborted”,这意味着从服务器在执行某个操作时...
Slave_SQL_Running: Yes It means that it was successful. Errors in the whole process: Slave_IO_Running: Connecting 1. Mine is the wrong host ip. 2. There are still some firewalls on the ...
### MySQL主从配置知识点详解 ...以及在从服务器上编辑配置文件、配置复制参数、启动复制进程和检查复制状态的方法。通过遵循这些步骤,可以成功实现MySQL的主从复制配置,从而达到数据备份和读写分离的目的。
如果'Slave_IO_Running'和'Slave_SQL_Running'都显示为'Yes',说明主从复制已经成功配置。 以上就是Linux下MySQL的二进制安装和主从复制的详细过程。请根据实际环境调整相关命令,确保所有步骤顺利进行。在实际...
mysql> show master status; +------------------+----------+--------------+--------------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +----...
- 在从机执行 `SHOW SLAVE STATUS\G` 来检查复制状态,确认Slave_IO_Running和Slave_SQL_Running都是Yes。 2. 故障排除: - 如果复制失败,根据SHOW SLAVE STATUS提供的错误信息进行诊断和修复。 3. 复制优化: ...
- 如果出现`Slave_IO_Running: No, Slave_SQL_Running: Yes`的情况,需要通过以下命令来设置从服务器的复制起点: ```sql CHANGE MASTER TO MASTER_LOG_FILE='mysqlbin.000003', MASTER_LOG_POS=1835; START ...
`,确认`Slave_IO_Running` 和 `Slave_SQL_Running` 的值均为`YES`。 - 查看`SHOW PROCESSLIST;`命令的结果中是否有与复制相关的线程。 2. **复制异常处理**: - 当出现复制中断或数据不一致的情况时,可以通过...
如果在配置过程中遇到问题,如`Slave_IO_Running`为`No`,可以检查 `/usr/local/mysql/var` 目录下的错误日志,找出错误原因并解决。此外,网络问题、权限问题、配置文件错误等都可能导致同步失败。确保主从服务器...
- **Slave_SQL_Running**: 指示slave SQL线程的状态。 - **Yes**: SQL线程运行正常。 - **No**: SQL线程已停止,同样需要排查原因。 **小结**:通过这些状态,可以快速了解主从复制的整体情况,是进行后续操作的...