国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

Mysql誤刪除數據庫怎么恢復

發(fā)布時(shí)間:2021-09-14 18:07 來(lái)源:億速云 閱讀:0 作者:chen 欄目: Mysql 歡迎投稿:712375056

這篇文章主要講解了“誤刪除數據怎么恢復”,文中的講解內容簡(jiǎn)單清晰,易于學(xué)習與理解,下面請大家跟著(zhù)小編的思路慢慢深入,一起來(lái)研究和學(xué)習“Mysql誤刪除數據庫怎么恢復”吧!


----誤刪除數據庫恢復-------------


備份時(shí)間點(diǎn):
-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000211', MASTER_LOG_POS=12737491;


全備恢復:
mysql -uroot -p -h227.0.0.1<monitor_2016-05-24.sql  

分析binlog日志:
mysqlbinlog  -vvv mysql-bin.000211 --database=monitor >/tmp/monitor_binlog211.sql
mysqlbinlog  -vvv mysql-bin.000212 --database=monitor >/tmp/monitor_binlog212.sql


找出drop table的操作
grep -i "drop table" /tmp/monitor_binlog212.sql

找出誤update操作:
mysqlbinlog  --no-defaults  -vvv mysql-bin.000710  --database=ticket --start-datetime="2016-06-21 16:05:00" |grep -B 50 '### UPDATE `ticket`.`cinema`'  |more

vi /tmp/monitor_binlog212.sql
/DROP TABLE IF EXISTS "analysedubborequest" 


# at 10970522
#160525 11:42:23 server id 108  end_log_pos 10970597 CRC32 0x3ccef367   Query   thread_id=162474        exec_time=0     error_code=0
SET TIMESTAMP=1464147743/*!*/;
BEGIN
/*!*/;
# at 10970597
# at 10970664
# at 10970886
#160525 11:42:23 server id 108  end_log_pos 10970917 CRC32 0xd89947f3   Xid = 24254453
COMMIT/*!*/;
# at 10970917
#160525 11:42:26 server id 108  end_log_pos 10971065 CRC32 0x3c4914bf   Query   thread_id=168489        exec_time=0     error_code=0
use `monitor`/*!*/;
SET TIMESTAMP=1464147746/*!*/;
SET @@session.foreign_key_checks=0/*!*/;
DROP TABLE IF EXISTS "analysedubborequest" /* generated by server */
/*!*/;
# at 10971065

注:
DROP TABLE IF EXISTS "analysedubborequest" /* generated by server */ 
在# at 10970917(start-position)和end_log_pos 10971065 (stop-position)刪除操作在這個(gè)位置


增量恢復:
mysqlbinlog --start-position='12737491' mysql-bin.000211 --database=monitor | mysql -uroot -p
mysqlbinlog --stop-position='10970522' mysql-bin.000212 --database=monitor | mysql -uroot -p

其它:
查看binlog events:
show binlog events in 'mysql-bin.000212'\G 

基于時(shí)間點(diǎn)查看,不準
mysqlbinlog  -vvv mysql-bin.000212 --startdatetime='時(shí)間' --stopdatetime='時(shí)間' --database=monitor  

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

午夜男女无遮挡拍拍视频| 97人妻精品一区二区三区| AV无码久久久久不卡免费网站| 欧洲乱码伦视频免费| 亚洲国产精品毛片AV不卡在线| 久久精品aⅴ无码中文字字幕重口|