您的当前位置:首页 --> MYSQL教程 |
mysql主从库不同步问题解决方法 |
浏览次数:895 关键词 ( ) |
遇到这样的错误如:“Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'”等或由于清数据导致主从库不同步了,解决办法如下: 先进入slave中执行:"slave stop;"来停止从库同步; 再去master中执行:"flush logs;"来清空日志; 然后在master中执行:"show master status;"查看下主库的状态,主要是日志的文件和position; 然后回到slave中,执行:"CHANGE MASTER TO MASTER_LOG_FILE='log-bin.000004',MASTER_LOG_POS=106;",文件和位置对应master中的; 最后在slave中执行:"slave start;"来启动同步。 |
下一条 SQL计算timestamp的差值的方法 上一条 解决mysql ERROR 1017:Can't find file: '/xxx.frm' 错误 |
数千企业与站长的选择,7*24小时稳定运行
了解更多套餐详细