Skip to content

Instantly share code, notes, and snippets.

@macna
Created April 18, 2015 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macna/3a97a692e35da91b8ed2 to your computer and use it in GitHub Desktop.
Save macna/3a97a692e35da91b8ed2 to your computer and use it in GitHub Desktop.
A script for dumping a MySQL database to flat file, including a time/date stamp in the file name.
mysqldump <dbname> -uroot --skip-triggers > "D:\<your>\<folder>\<dbname>%time:~0,2%%time:~3,2%%time:~6,2%_%date:~-10,2%%date:~-7,2%%date:~-4,4%.sql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment