简体   繁体   中英

How to find which user Deleted Store Procedures in MYSQL

I have been trying to find who deleted Store Procedure in MYSQL Database. All I got his

SELECT * FROM  mysql.general_log  WHERE user_host rlike '(user)+' ;

But not able to fetch anything .

Is there any best understandable way to recover the Deleted Store procedure or any other object in MYSQL.

  1. Execute
show variables like 'gen%';

Ensure that general_log is ON.

Look for general log filename.

  1. Execute
show variables like 'data%';

Look for data directory root path.

  1. Go to the data directory root. Copy the general log file somewhere.

  2. Open maked log copy in any text editor. Search it for Query event and DROP PROCEDURE statement, look for connection number.

  3. Search the file from the line found to the start of file (up) for this connection number. Look for closest Connect event for this connection number, and look the account.

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