ERROR 1201 (HY000): Could not initialize master info structure
8223 ワード
mysql主従非同期、手動同期時に発生したエラー:
ネット上の先輩たちの解決策には、サーバーからの中継ログの削除とreset slaveの2つがある.
1:エラー・ログの表示
2:バイナリ・ログ情報の表示
3:master情報の表示
1つ目の解決方法:
2つ目の解決策:
- mysql>stop slave;
- mysql>change master to master_host='192.168.1.80',
- >master_user='admin',
- >master_password='123456',
- >master_log_file='mysql-bin.000519',
- >master_log_pos=107;
- ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log
ネット上の先輩たちの解決策には、サーバーからの中継ログの削除とreset slaveの2つがある.
1:エラー・ログの表示
- [root@test mysql]# tail test.com.err
- 121229 11:34:01 [ERROR] Could not find target log during relay log initialization
- 121229 11:38:05 [ERROR] Failed to open the relay log './81-relay-bin.000047' (relay_log_pos 12247)
- 121229 11:38:05 [ERROR] Could not find target log during relay log initialization 121229 11:42:51 [ERROR] Failed to open the relay log './81-relay-bin.000047'
-
- (relay_log_pos 12247)
- 121229 11:42:51 [ERROR] Could not find target log during relay log initialization
- 121229 11:42:54 [ERROR] Failed to open the relay log './81-relay-bin.000047' (relay_log_pos 12247)
- 121229 11:42:54 [ERROR] Could not find target log during relay log initialization
- 121229 11:44:41 [Note] 'CHANGE MASTER TO executed'. Previous state master_host='192.168.1.80', master_port='3306', master_log_file='',
-
- master_log_pos='4'. New state master_host='192.168.1.80', master_port='3306', master_log_file='mysql-bin.000583', master_log_pos='6682'.
- 121229 11:44:52 [Note] Slave SQL thread initialized, starting replication in log'mysql-bin.000583' at position 6682, relay log './test-relay-bin.000001' position: 4
-
2:バイナリ・ログ情報の表示
- [root@test mysql]# cat relay-log.info
- ./test-relay-bin.000002
- 253
- mysql-bin.000583
- 6682
3:master情報の表示
- [root@test mysql]# cat master.info
- 18
- mysql-bin.000583
- 6682
- 192.168.1.80
- rep
- 11111
- 3306
- 60
- 0
1つ目の解決方法:
- [root@test mysql]#service mysqld stop
- [root@test mysql]#rm -rf master.info
- [root@test mysql]#rm -rf relay-log.info
- [root@test mysql]#service mysqld start
- mysql>change master to master_host='192.168.1.80',
- >master_user='admin',
- >master_password='123456',
- >master_log_file='mysql-bin.000519',
- >master_log_pos=107;
- mysql>start slave;
2つ目の解決策:
- mysql> reset slave;
- mysql>change master to master_host='192.168.1.80',
- >master_user='admin',
- >master_password='123456',
- >master_log_file='mysql-bin.000519',
- >master_log_pos=107;
- mysql>start slave;