DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Export Your MySQL Database Schema

06.01.2005
| 52627 views |
  • submit to reddit
        
mysqldump --no-data --tables -u YOUR_USER_NAME -p DATABASE_YOU_WANT_SCRIPTED >> FILENAME.sql

example:
mysqldump --no-data --tables -u larry -p contacts >> contacts.sql

If you want the data as well, omit the "--no-data" portion.