Skip to content

Instantly share code, notes, and snippets.

@johnefemer
Forked from rakeshtembhurne/import_export_gz.sql
Created January 11, 2023 19:21
Show Gist options
  • Save johnefemer/65a8a7d9d89c475a593ab07852d8199d to your computer and use it in GitHub Desktop.
Save johnefemer/65a8a7d9d89c475a593ab07852d8199d to your computer and use it in GitHub Desktop.
MySQL: Import and export in gzip form
// Export database in gzip form
mysqldump -u user -p database | gzip > database.sql.gz
// Import database from gzip form
gunzip < database.sql.gz | mysql -u user -p database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment