How can I roll back my last delete command in MySQL?

后端 未结 10 2165
臣服心动
臣服心动 2020-12-25 09:32

I accidentally deleted some huge number of rows from a table...

How can I roll it back?

I executed the query using PuTTY.

I\'ll be grateful if any of

10条回答
  •  暖寄归人
    2020-12-25 10:15

    Use the BEGIN TRANSACTION command before starting queries. So that you can ROLLBACK things at any point of time.

    FOR EXAMPLE:

    1. begin transaction
    2. select * from Student
    3. delete from Student where Id=2
    4. select * from Student
    5. rollback
    6. select * from Student

提交回复
热议问题