What should I do if mysql accidentally deletes the database?

What should I do if mysql accidentally deletes the database?

The solution to mysql accidentally deleting the database: first open the binlog function of mysql; then check the binary log status; then check the operation log of the binary log file; finally restore the data through the Bin log. Add a line of log-bin code under [mysqld], as follows: # Replication Master Server (default) # binary logging is required for replication log-bin=mysql-bin # binary logging format – mixed recommended binlog_format=mixed. 2. Use the following method to view the binary log status: whether it is enabled mysql> show variables like 'log_%'; 3. View all binary log files: mysql> show libary logs; mysql> show binary logs; +——————+————+ | Log_name | File_size | +——————+————+ | mysql-bin.000001 | 201 | | mysql-bin.000002 | 351 | | mysql-bin.000003 | 276 | | mysql-bin.000004 | 201 | | mysql-bin.000005 | 16509 | 4. Mysql checks the operation log of the binary log file #mysqlbinlog –start-position=0 /mydata/data/mysql-bin.000089 [root@test mysql]# mysqlbinlog –start -position=0 –stop-position=500 mysql-bin.000091 Warning: option ‘start-position’: unsigned value 0 adjusted to 4 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #151022 18:00:43 server id 1 end_log_pos 107 Start: binlog v 4, server v 5.5.38-log created 151022 18:00:43 at startup #…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索