MySQL 8.0 誤update數(shù)據(jù)后使用mysqlbinlog解析出來的語句將生產(chǎn)庫內(nèi)所有表刪除并重建
發(fā)布時間:2023-07-08
客戶在生產(chǎn)環(huán)境誤更新了一張表的數(shù)據(jù),嘗試使用binlog恢復(fù)誤更新數(shù)據(jù)的時候誤將所有表刪除并重建。 MySQL誤操作數(shù)據(jù)修復(fù) MySQL數(shù)據(jù)庫修復(fù) MySQL數(shù)據(jù)庫事務(wù)日志恢復(fù)
客戶名稱: 保密
數(shù)據(jù)類型: MySQL 8.0.33 on Windows
數(shù)據(jù)庫大小: 1 GB
故障檢測: 客戶執(zhí)行update語句未加where條件誤更新了一張表的一個字段的所有內(nèi)容,客戶MySQL實例開啟了log_bin??蛻魢L試使用mysqlbinlog解析binlog事務(wù)日志內(nèi)容獲取回滾語句,但是誤操作將生產(chǎn)數(shù)據(jù)庫內(nèi)所有表刪除并重建了。
使用老備份及不全的binlog恢復(fù)。
執(zhí)行mysqlbinlog解析出來的語句時報錯:
[ERROR] [MY-013146] [Repl] Replica SQL: Column 17 of table 'supervisor.b_witness_data' cannot be converted from type 'blob' to type 'varchar(300(bytes) utf8mb3)', Error_code: MY-013146
修改表結(jié)構(gòu):alter table supervisor.b_witness_data modify `witness_res` text DEFAULT NULL COMMENT '見證結(jié)論';
[ERROR] [MY-010584] [Repl] Replica SQL: Could not execute Update_rows event on table supervisor.sys_user; Can't find record in 'sys_user', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's source log FIRST, end_log_pos 48491639, Error_code: MY-001032
找不到行數(shù)據(jù)導(dǎo)致update執(zhí)行失敗,使用腳本將UPDATE語句內(nèi)容替換為REPLACE INTO。
修復(fù)結(jié)果: 數(shù)據(jù)恢復(fù)率達90% 客戶非常滿意。將恢復(fù)出來的所有表數(shù)據(jù)導(dǎo)入客戶生產(chǎn)環(huán)境使用沒有任何問題。
在此提醒大家重要的數(shù)據(jù)庫操作之前務(wù)必備份數(shù)據(jù)庫。
-----------------------------------------------------------------------------------------------------------
提供7*24專業(yè)SQL Server數(shù)據(jù)庫修復(fù),MySQL數(shù)據(jù)庫修復(fù),Sybase數(shù)據(jù)庫遠程及現(xiàn)場技術(shù)支持,Sybase ASE及Sybase SQL Anywhere數(shù)據(jù)庫修復(fù)服務(wù),Oracle數(shù)據(jù)庫修復(fù),PostgreSQL數(shù)據(jù)庫恢復(fù)。
我們可以幫您解決遇到的數(shù)據(jù)庫誤操作、數(shù)據(jù)庫報錯、數(shù)據(jù)庫損壞、被勒索病毒加密等故障問題。
電話:13811580958 (微信),QQ:289965371
We supply technical support for Sybase ASE and Sybase SQL Anywhere, also have many years of experience in recovering data from damanged Sybase devices. Contact us by
Phone: +86 13811580958
Wechat: 13811580958
Email: 289965371@qq.com
掃描以下北京雨翰數(shù)據(jù)恢復(fù)官方微信獲取專業(yè)數(shù)據(jù)庫恢復(fù)服務(wù):
