- ps -ef|grep mysql 查找mysql - ![在这里插入图片描述](https://img-blog.csdnimg.cn/6b1b406c9df34d7383f474ba42f4979e.png) - ![在这里插入图片描述](https://img-blog.csdnimg.cn/6831467023e04066a3cfb8540eee5fb9.png)
mysqlbinlog --base64-output=decode-rows --database=asset --start-datetime=“2022-09-29 09:30:00” --stop-datetime=“2022-09-29 09:36:00” -vv /data/mysql/3306/log/binlog/mysql-bin.000434 | more
mysqlbinlog --base64-output=decode-rows --database=asset --start-datetime=“2022-09-29 09:30:00” --stop-datetime=“2022-09-29 09:36:00” -vv /data/mysql/3306/log/binlog/mysql-bin.000434 > xxx.txt
使用行号匹配语法sed -n ‘/### UPDATE xxx.xxx /,/COMMIT/p’ xxx.txt >> b.txt
sed -n ‘54158,844483p’ xxx.txt >> b.txt
cat b.txt | sed -n ‘/###/p’ | sed ‘s/### //g;s//*./,/g;s/DELETE FROM/INSERT INTO/g;s/WHERE/SELECT/g;’ | sed -r ;s/(;23.),/1;/g’ | sed ‘s/;[0-9][0-9]=//g’ | sed ‘s/;[1-9]=//g’ > source.sql