You are here: Portal Home > Knowledgebase > Databases > How do I dump the table structure for my MySQL Database, but none of the data? Please Login or Register



How do I dump the table structure for my MySQL Database, but none of the data?

The command line option from SSH is:

mysqldump -d -u -p database_name > file.sql

Where "database_name" is the name of your database, and "file.sql" is the name of the file you would like to write the table structure to. It will prompt you for a password (-p) and this is required. Normally mysqldump gives you the entire database, with the "-d" option, you tell it to not include the data, but just the table structure.

Was this answer helpful?

Add to Favourites
Print this Article

Powered by WHMCompleteSolution

Pro Host Management
Language: