mysql从

#!/bin/bash
a=$(mysql -utom (写自己主里面授权的用户名)-p123456(授权的密码) -h10.0.0.36 -e ‘show master status;’ | awk '/mysql-bin/{print KaTeX parse error: Expected 'EOF', got '}' at position 2: 1}̲') b=(mysql -utom -p123456 -h10.0.0.36 -e ‘show master status;’ | awk ‘/mysql-bin/{print KaTeX parse error: Expected 'EOF', got '}' at position 2: 2}̲') #安装部署 yum -y…a’,master_log_pos=$b;"
#开启同步
mysql -e ‘start slave;’
echo “启动同步成功!!!”
sleep 20 #等待20秒执行
mysql -e ‘show slave status \G’

原创文章 167 获赞 6 访问量 4124

猜你喜欢

转载自blog.csdn.net/xiaowoniuwzx/article/details/105744927