mysql_button

2021/12/28 2:12:38

本文主要是介绍mysql_button,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.mysql查看备库状态(OS命令行)

mysql -uroot -p'pass' -S /tmp/mysql3406.sock -e "show slave status \G" |egrep -i "Master_Host|Running"

 

2.分析binlog内容

mysqlbinlog --no-defaults -v -v --base64-output=DECODE-ROWS mysql-bin.005265 | grep -A '5265' 121829808

 

3.修改my.cnf中show_compatibility_56和slow_query_log参数

cp /etc/my.cnf /etc/my.cnf0525.bak
if [ $(grep -i "show_compatibility_56" /etc/my.cnf |wc -l) -eq 0 ]; then sed -i '/\[mysqld\]/a\\show_compatibility_56=1' /etc/my.cnf; fi
if [ $(grep -i "slow_query_log" /etc/my.cnf |wc -l) -eq 0 ]; then sed -i '/\[mysqld\]/a\\slow_query_log=on' /etc/my.cnf; fi
cat /etc/my.cnf |egrep -i "show_compatibility_56|slow_query_log"

 

4.重置用户user1密码为password123

echo 'password123' | passwd --stdin user_1



这篇关于mysql_button的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程