Skip to content

Instantly share code, notes, and snippets.

@chinmayrajyaguru
Last active June 27, 2016 02:11
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 chinmayrajyaguru/0f0bb2b912284f2551d96573a1fcb26c to your computer and use it in GitHub Desktop.
Save chinmayrajyaguru/0f0bb2b912284f2551d96573a1fcb26c to your computer and use it in GitHub Desktop.
Import MySQL database through command line
/* A common use of mysqldump is for making a backup of an entire database: */
CREATE DATABASE database-name DEFAULT CHARACTER SET utf8 COLLATE utf8_uni code_ci; -- Create new DB if you don't have it.
GRANT ALL ON database-name.* TO 'user-name'@'localhost' IDENTIFIED BY 'user-password'; -- Give permission to access your created DB.
use database-name;
source path/file.sql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment