- Open the Command Prompt (Windows)/Terminal (Linux)
- Go to the folder where it is the MySQL dump/backup file
- Type the following command:
mysql -u {username} -p{password} -h{host} {databaseName} < {backup-name}.sql
{password} is the login's password
{host} is the server name where it is the database
{databaseName} is the database name
{backup-name} is the name back up file name
Example:
I want to restore the Meemaw.sql dump/backup file to the BAZINGA database located at the TheBigBangTheory host with the user name Sheldon and password Cooper.
mysql -u Sheldon -pCooper -h TheBigBangTheory BAZINGA < Meemaw.sql
Source: http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/
No comments:
Post a Comment