TIMEX
TIMEX

Reputation: 271744

In MySQL, how do I dump instructions to create that database again?

Let's say I have many records in this DB. But I want to clone this database structure, but start off with 0 records.

Basically, I want to "dump" the instructions to create the tables/cols of that database. THen, I want to run these instructions.

How can I do that?

Upvotes: 0

Views: 77

Answers (4)

Zydeco
Zydeco

Reputation: 530

If you have phpmyadmin, you can easily do this by navigating to your table (or database) you want to backup, then clicking on the "Export" tab. Make sure "structure" and "data" are checked.

When you're ready to import it, make sure your table (or database) doesn't exist, and click on the "import" tab. Browse to your local copy and upload it.

If you don't have phpmyadmin, and you're really not secure with mysql, you really should have your sysadmin install it for you.

Upvotes: 0

magallanes
magallanes

Reputation: 6854

a) using mysqldump

b) use a visual tool and connect to your mysql database, SQLYOG for example (exist a community-freeware version that do the trick).

c) configure phpmyadmin (if you have a lamp or wamp), it allow to do the same via web.

Upvotes: 0

diagonalbatman
diagonalbatman

Reputation: 18002

You need to look into mysqldump. Link to the manual here http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

Upvotes: 0

CanSpice
CanSpice

Reputation: 35788

You want to run mysqldump with the --no-data flag.

Upvotes: 1

Related Questions