nrs jayaram
nrs jayaram

Reputation: 3438

how to export database from mysql with empty tables?

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

Answers (3)

KawaiKx
KawaiKx

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

Emeka Mbah
Emeka Mbah

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

Santosh Achari
Santosh Achari

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

Related Questions