I have a MySQL dump (.sql file) which I want to restore. I am trying to restore it using Navicat, but somehow I just can't do this. Maybe I am missing some info here. I have tried following the steps in this link http://www.navicat.com/manual/online_manual/en/navicat/win_manual/DumpExecuteSQL.html But the Execute SQL File is grayed out. Any idea of how to proceed? I am at lost here.
Asked
Active
Viewed 1,606 times
0
-
1Dunno about navicat but you can execute a sql file from the MySQL command line, E.g. [How to import an SQL file using the command line in MySQL?](http://stackoverflow.com/questions/17666249/how-to-import-an-sql-file-using-the-command-line-in-mysql) – Alex K. Feb 17 '16 at 11:07
-
1@AlexK. You mean open the cmd and then try this :mysql -u username -p database_name < file.sql ? – refresh Feb 17 '16 at 11:12
-
Yes. (If that doesn't work run it from the directory where the mysql executable is) – Alex K. Feb 17 '16 at 11:13
-
I don't get how this works. Where will the database be restored? And how do I make queries on it? – refresh Feb 17 '16 at 11:14
-
1use following command : mysql -u username –-password=password database_name < file.sql – Kunal Surana Feb 17 '16 at 11:18
-
@KunalSurana: I don't get how this works. Where will the database be restored? And how do I make queries on it? – refresh Feb 17 '16 at 11:20
-
Do you have compelete dump of database in your .sql file ? if yes then run above command to import everything. – Kunal Surana Feb 17 '16 at 11:21
-
@KunalSurana : I believe so, yes – refresh Feb 17 '16 at 11:22
-
Mysql is install on windows or linux – Kunal Surana Feb 17 '16 at 11:24
-
@KunalSurana : OK. And how do I make queries on the restored database? – refresh Feb 17 '16 at 11:26
2 Answers
0
Make sure the database is created first. After creating the database, right click on the database and select Execute sql file. After selecting this, you will get a popup window where you can select your sql file and click on start. Now all the data from the backup will be loaded in your database.

MichielB
- 4,181
- 1
- 30
- 39