Is there a way to test the MySQL queries, without modifying my database?
For example, can I run a DELETE FROM my_table WHERE id = 101 without actual delete anything? What about INSERT and UPDATE?
TY
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could start a transaction before running your queries and then rollback after running them. Note that to do this you’ll require InnoDB or XtraDb tables (won’t work on MyISAM).
To start a transaction send to MySQL the following statement:
And at the end of your queries run the following statement:
Your database will never be modified from the point of view of other connections. Your current connection will see the changes until ROLLBACK, and after that the original state will be restored.