Skip to content

Instantly share code, notes, and snippets.

@jvidalba1
Last active August 29, 2015 13:57
Show Gist options
  • Save jvidalba1/9672466 to your computer and use it in GitHub Desktop.
Save jvidalba1/9672466 to your computer and use it in GitHub Desktop.
Export data from mysql by command line
  • Export only data
mysqldump -u [username] -p --no-create-db --no-create-info [database_name]+ [table_name]* > [filename]+.sql 
  • Export only structure
mysqldump -u [username] -p --no-data [database_name]+ [table_name]* > [filename]+.sql 
  • Export all data and structure
mysqldump -u [username] -p [database_name]+ [table_name]* > [filename]+.sql
  • Export data from query
mysqldump -u [username] -p --databases bd_coop --tables esquemas --where="entidad_id = 1010" > test.sql

I have not needed more options yet, if you'd like to use more options, you can go to the following link:

http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment