MySQL主主模式無法開機記錄同步進程問題處理

來源:互聯網
上載者:User

兩台互為主從mysql資料庫伺服器硬體升級,正常伺服器關閉,硬體升級完畢,啟動伺服器,發現主從同步進程為關閉狀態,mysql> show slave status\G;

*************************** 1. row ***************************

Slave_IO_Running: No

Slave_SQL_Running: No

mysql互為主從,但是在SLAVE執行CHANGE MASTER時,出現這個錯誤:

mysql> slave stop;

mysql> change master to master_host='172.17.2.10',master_user='sync',master_password='123456',master_log_file='updatelog.000004',master_log_pos=106;

ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log

在另外一台上執行也是一樣提示這個錯誤。  網上查了一些資料,發現大概有兩種方法解決這個問題,1.是清理mysql的相關日誌;2.是reset slave ;但是清理日誌的方法有點複雜,使用第2種方法比較方便。

mysql> slave stop;

mysql> reset slave;

mysql> change master to master_host='172.17.2.10',master_user='sync',master_password='123456',master_log_file='updatelog.000004',master_log_pos=106;

mysql> slave start;

另外一台也按照這種方法執行,輕鬆搞定。配置完成查看mysql主從同步狀態正常!

mysql >  show slave  status \G;

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.