0

I have Mysql database. I want to take only the skeleton of my database i.e.I want only the scripts to create Database and tables. Not the entire database back up which comes with database structure and data.

Please Help me. I Use Mysql 5.0

0

3 Answers 3

3
mysqldump --all-databases --no-data
Sign up to request clarification or add additional context in comments.

1 Comment

+1 for --all-databases option.
0

From MySql export schema without data:

You can do with the --no-data option with mysqldump command

mysqldump -u root -p --no-data dbname > schema.sql

Jim helpfully contributes:

consider using the --single-transaction option if you don't want or can't do table locks.

Comments

0

Here is my summary about mysql dumping commands, hope to help you

backup the entire database

mysqldump -uroot -p db_name > /home/bob/my.sql

backup single table

mysqldump -uroot -p db_name table_name > /home/bob/table.sql

backup only database structure,

mysqldump -uroot -p db_name -d > /home/bob/structure.sql

backup only database data

mysqldump -uroot -p db_name -t > /home/bob/data.sql


How to execute the exported sql file? See the following

mysql -uroot -p db_name < /home/bob/my.sql

another way, Log into mysql, then

mysql> use db_name;

mysql> source /home/bob/my.sql;

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.