I am trying to empty the database of any data, while keeping the relationships and tables as they are
I have no idea if my thinking is right or wrong
I am trying to empty the database of any data, while keeping the relationships and tables as they are
I have no idea if my thinking is right or wrong
3
Answers
Yes, you just run mysqldump with –no-data
You can save it to a .sql file and then drop your database
Then you restore it from the dump
table_name is the table you want to delete all data in it.
truncate only works on tables, so you need to execute truncate table one by one.
Use truncate to all table :
or you can read this, similar problem.