Skip to content

Instantly share code, notes, and snippets.

@light9
Created September 17, 2013 17:49
Show Gist options
  • Select an option

  • Save light9/6597974 to your computer and use it in GitHub Desktop.

Select an option

Save light9/6597974 to your computer and use it in GitHub Desktop.
//Copy/Export a Large Database
mysqldump -u [USERNAME] -p [DBNAME] | gzip > [/path_to_file/DBNAME].sql.gz
//Import a Large Database
//First, unzip the file.
//gzip -d [/path_to_file/DBNAME].sql.gz
mysql -u root -p
SHOW DATABASES;
CREATE DATABASE [DBNAME];
USE [DBNAME];
SOURCE [/path_to_file/DBNAME].sql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment