您好,登錄后才能下訂單哦!
CHANGE MASTER TO MASTER_HOST='10.10.30.34', MASTER_PORT=3306, MASTER_USER='slave', MASTER_PASSWORD='slave', MASTER_LOG_FILE='mysql-bin.000148', MASTER_LOG_POS=154; 從數據庫變為主庫 stop slave; reset slave; reset master; 從庫變為剛才的主庫(由從庫變為主庫的數據庫) vim /etc/my.cnf log-bin=mysql-bin #并重啟數據庫,主庫開啟binlog日志 主庫操作:show master status 主庫操作:scp -r /var/lib/mysql/* 10.10.50.34:/var/lib/mysql/ 從庫:chown -R mysql.mysql /var/lib/mysql/ 從庫:systemctl restart mysqld CHANGE MASTER TO MASTER_HOST='172.16.1.51', MASTER_PORT=3306, MASTER_USER='rep', MASTER_PASSWORD='123456', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=335; 進入數據:start slave; 中間報錯: 1.IO進程一直處于connnecting中 slave 用戶的密碼寫錯 2.show slave status;報錯 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' 解決辦法: 主庫:flush logs; 從庫: stop slave; CHANGE MASTER TO MASTER_LOG_FILE='mysqld-bin.000011',MASTER_LOG_POS=106; start slave;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。