Skip to content

Instantly share code, notes, and snippets.

@blindpet
Last active August 29, 2015 14:24
Show Gist options
  • Save blindpet/522d1ddfec6385b022cf to your computer and use it in GitHub Desktop.
Save blindpet/522d1ddfec6385b022cf to your computer and use it in GitHub Desktop.
mysql help
mysqldump -u [user] -p[password] [database] [table] > [output_file_name].sql
mysqldump -p --user=example --where="x = 'y' AND id = 2" dbname tablename >> dump.sql
#dumping last rows
mysqldump -uroot -p db_name table_name --where='id<1000000'
or you can use
SELECT * INTO OUTFILE 'data_path.sql' from table where id<100000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment