器量大者,福泽必厚
全部博文(587)
分类: LINUX
2010-01-22 10:37:11
100122 10:21:04 [ERROR] Slave I/O thread: error connecting to master : Error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111' errno: 2013 retry-time: 3306 retries: 86400 |
###解决问题的过程!
mysql> reset slave; |
还有一种解决方法:
mysql> STOP SLAVE;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH TABLES WITH READ LOCK;
Query OK, 0 rows affected (0.00 sec)
mysql> UNLOCK TABLES;
Query OK, 0 rows affected (0.00 sec)
mysql> CHANGE MASTER TO MASTER_LOG_FILE='mysqld-bin.00000*';
Query OK, 0 rows affected (0.00 sec)
mysql> CHANGE MASTER TO MASTER_LOG_POS=*;
Query OK, 0 rows affected (0.00 sec)
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)
The Slave IO and SQL are now both yes. Slave_IO_State: Waiting for master to send event .
显然问题即可解决!
mysql replcation中遇到的小问题(easy!)
问题2:
问题3:
原因:在change ××××时master_user='*",master_password='*"写错一个或全部写错或用户根本不存在!
问题4:
出错如下:
ERROR 1598 (HY000): Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
解决方法:在/etc/my.cnf中加入 binlog_format = mixed
问题5:在做master/slave时,为了确保数据的一致性,原想把master库锁住,将master上的所有库都复制到slave库上去,结果执行flush tables with read lock后很快就可以插入数据了,flush tables with read lock很快就释放锁了!
原因:
wait_timeout = 10
interactive_timeout = 10
设置太小导致锁失败
修改为:
wait_timeout = 28800 #8个小时
interactive_timeout = 28800 #8个小时