I have file.sql, and I want to restore it. I found this command:
mysql -u username -p database_name < file.sql
Where should I put \'file.sql\' in
Import Database
1. Go to drive
command: d:
2. Mysql login
command: c:\xampp\mysql\bin\mysql -u root -p
3. Will ask for pwd: enter it
pwd
4. Select db
use DbName;
5. Provide file name
\. G:DbName.sql
you need to point to the location of your file using:
mysql -u username -p database_name < drive:\\path_to_your_file\file.sql
Type the following command to import sql data file:
$ mysql -u username -p -h localhost DATA-BASE-NAME < data.sql
In this example, import 'data.sql' file into 'blog' database using vivek as username:
$ mysql -u sat -p -h localhost blog < data.sql
If you have a dedicated database server, replace localhost hostname with with actual server name or IP address as follows:
$ mysql -u username -p -h 202.54.1.10 databasename < data.sql
OR use hostname such as mysql.cyberciti.biz
$ mysql -u username -p -h mysql.cyberciti.biz database-name < data.sql
If you do not know the database name or database name is included in sql dump you can try out something as follows:
$ mysql -u username -p -h 202.54.1.10 < data.sql
Refer: http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html