Press "Enter" to skip to content

Techy Snippet: MySQL Database Schema Dump

To extract/export just the schema/design/create tables section of a MySQL table via the command line, you need to use a command such as:

mysqldump –no-data [databasename] [optional table name] -u[user name] -p > extract.sql
(enter the [username] mysql user password)

To import it again, use:

mysql -u [username] -p [databasename] < extract.sql See also: MySQL Docs: MySQLDump.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.