mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/3307/data/ mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/3308/data/ mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/3309/data/
mysql -uroot -p123 -e "select @@server_id" mysql -uroot -p123 -e "select @@server_uuid"
mysql -uroot -p123 -e "select @@gtid_mode" mysql -uroot -p123 -e "select @@server_gtid" vi 330{7..9}/my.cnf gtid_mode=ON enforce_gtid_consistency=ON log_slave_updates=ON
mysql -uroot -p123 -e "select @@log_bin"
mysqldump -uroot -p123 -h 192.168.84.30 -P 3307 > /tmp/full.sql
mysql> source /tmp/full.sql
grant replication slave on *.* to repl@'192.168.84.30' identified by '123';
幫助: mysql> help change master to ...... 找到配置模板: CHANGE MASTER TO MASTER_HOST='master2.example.com', MASTER_USER='replication', MASTER_PASSWORD='password', MASTER_PORT=3306, MASTER_LOG_FILE='master2-bin.001', MASTER_LOG_POS=4, MASTER_CONNECT_RETRY=10; 3308,3309使用如下配置: CHANGE MASTER TO MASTER_HOST='192.168.84.30', MASTER_USER='repl', MASTER_PASSWORD='123', MASTER_PORT=3307, master_auto_position=1; 開始配置3308 mysql> CHANGE MASTER TO -> MASTER_HOST='192.168.84.30', -> MASTER_USER='repl', -> MASTER_PASSWORD='123', -> MASTER_PORT=3307, -> master_auto_position=1; Query OK, 0 rows affected, 2 warnings (0.00 sec) 開始配置3309 mysql> CHANGE MASTER TO -> MASTER_HOST='192.168.84.30', -> MASTER_USER='repl', -> MASTER_PASSWORD='123', -> MASTER_PORT=3307, -> master_auto_position=1; Query OK, 0 rows affected, 2 warnings (0.00 sec)
網(wǎng)站名稱:MySQL5.7基于GTID搭建主從復(fù)制-創(chuàng)新互聯(lián)
文章出自:http://muchs.cn/article44/popee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、云服務(wù)器、外貿(mào)建站、搜索引擎優(yōu)化、網(wǎng)站設(shè)計(jì)公司、服務(wù)器托管
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容