Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a database on Machine A. What I want is to dump my database in such a way that when I import it on another machine (Machine B) only the structure of the tables and Database are created.

I want no data.

Can mysqldump be used here?

share|improve this question
up vote 5 down vote accepted


If you want to import the structure of the Database on some other machine there are some steps as follows

1.on Machine A(generate the dump without the data)

mysqldump -uuser -ppass --no-data --databases db1 db2 db3 > database_structure.sql

using mysqldump with --no-data will generate the dump without the data.

if you want only data dump do as(It will not contain the create statements)

mysqldump -uuser -ppass --no-create-info --databases db1 db2 db3 > database_data.sql

2.copy the database_structure.sql on Machine B

Then you want to restore its structure on Machine B do

3.mysql -uuser -ppass < database_structure.sql

Then you have database structure available on the Machine B.

try it..

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.