The syntax is as follows to import the data created by mysqldump command:
In this example import a file called sales.sql for salesdb1 user and sales db, enter:
mysql -u {DB-USER-NAME} -p {DB-NAME} < {db.file.sql}
mysql -u {DB-USER-NAME} -h {MySQL-SERVER-HOST-NAME} -p {DB-NAME} < {db.file.sql}
$ mysql -u sales -p salesdb1 < sales.sql
If database salesdb1 does not exists, first create it and than import it as follows:
$ mysql -u root -p -e 'create database salesdb1'
$ mysql -u sales -p salesdb1 < sales.sql
No comments:
Post a Comment