简体   繁体   中英

Temporary Drop Table in mysql

I need to drop or destroy the database table for a small period of time. Is there any way to drop the table for a temporary situation by MySQL query After that I need to restore it again to use it?

I need my SQL Queries the Drop table temporarily and has to restore it again.

you can use mysql binlog flashback your table; setup 1: binlog_format=row in your my.cnf

setup2: show master status; show binlog events in 'XXXdb-binlog.00000X';

find your action for drop table

setup3: mysqlbinlog --base64-output=decode-rows -v -v XXXdb-binlog.00000X |sed -n '/### DELETE FROM db_name . table_name /,/COMMIT/p' > recover_table.txt

setup4: source recover

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM