is there a way to apply a query to each table in a mysql database?
Something like
SELECT count(*) FROM {ALL TABLES}
-- gives the number of count(*) in each Table
and
DELETE FROM {ALL TABLES}
-- Like DELETE FROM TABLE applied on each Table
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.
beware this is just an approximate value
In order to delete the contents of all your tables you can do something like this
Then run the output of this query.
UPDATE.
This is a stored procedure to apply
truncate tableto all tables in a specific database