Example of restoring a database using bin log logs
- 2020-05-15 02:17:48
- OfStack
1. Check whether logging is enabled:
show variables like 'log_bin';
2. View the current log file name:
show master status;
3. Find the current binary log files:
mysql
>
show binary logs;
4. Check the mysql log:
mysqlbinlog mysql-bin.000001
mysqlbinlog mysql-bin.000006
>
/root/bbx.log
5. Use the new binlog log :(update the database log)
methods 1 : [root@bogon mysql]# mysqladmin -uroot -p flush-logs
methods 2 : mysql> FLUSH LOGS;
methods 3 : [root@bogon mysql]# /etc/init.d/mysql restart