Reputation: 3438
I have a database in .sql format, while restore the database to localhost all tables have unknown data. how can i delete all tables data before or after import.
i am using windows 7. mysql server 5.5
Upvotes: 0
Views: 3754
Reputation: 9910
phpmyadmin has an option for this task.
Select the database, you wish to export with empty tables
Click on Export
Select Custom in Export Method
Scroll down to Format-specfic options
Select Structure instead of Structure and data
Click on Go
That's all there is to it.
Upvotes: 5
Reputation: 17520
if you have access to PhpMyAdmin http://localhost/phpmyadmin/
on your localhost simply login and drop the tables in the database you wish to import SQL dumps.
Then import the SQL dump file (.sql)
Upvotes: 1
Reputation: 3006
You could use this query to export database with no data:
mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE]
You can also look at other options [here.]1
Upvotes: 2