运维内容
# mysqldump
mysqldump -h 127.0.0.1 -uroot -pL@cc12345 -P 33306 api_factory >api_factory.sql
# binlog恢复数据
- 这种操作类似于把这段时间的所有语句再执行一遍。
# 查看binlog数据找到对应的时间或者start pot.
show binlog events in 'binlog.000017';
# 多个binlog 按时间写入到文件中。
mysqlbinlog binlog.000003 binlog.000004 binlog.000005 binlog.000006 binlog.000007 binlog.000008 binlog.000009 binlog.000010 binlog.000011 binlog.000012 binlog.000013 binlog.000014 binlog.000015 binlog.000016 binlog.000017 binlog.000018 binlog.000019 binlog.000020 binlog.000021 binlog.000022 binlog.000023 binlog.000024 binlog.000025 binlog.000026 --start-datetime="2022-10-23 01:00:00" --stop-datetime="2022-10-25 21:10:12" --database=api_factory > back.sql
# -f 忽略报错。
cat back.sql | mysql -f -h 127.0.0.1 -P 33306 -u root -pL@cc12345 api_factory
1
2
3
4
5
6
2
3
4
5
6
mysqldump -h 116.204.74.119 -uroot -pevn_L@cc12345 -P 13306 api_factory >api_factory-119-2022-11-12.sql
- 如果需要把delete语句逆向操作需要借助其他的工具。 https://www.modb.pro/db/397973
编辑 (opens new window)
上次更新: 2023/09/21, 13:59:42