Skip to content

Instantly share code, notes, and snippets.

@JohnathanMarkSmith
Created May 6, 2013 13:30
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 JohnathanMarkSmith/5525146 to your computer and use it in GitHub Desktop.
Save JohnathanMarkSmith/5525146 to your computer and use it in GitHub Desktop.
How to load MySQL Database from Command Line in Linux
I been getting asked, How can I load my MySQL database from the command line?
So I am going to make this quick and easy…
First cd in the folder where your sql file is, for this demo I am using a file called “backup.mysql”. Then use the following command
mysql --user root --password regandb < backup.mysql
MySQL will prompt you for a password then your mysql will be loaded depending on how big your backup/file is it may take some time. You could add a -f flag if your database is very big, it will prevent it from stopping if there is error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment