How can we restore MySQL database via Command Prompt?

kumkumsharma

Administrator
Staff member
  • First open Command Prompt in your Windows server.
  • Now use below command to navigate to MySQL bin folder.
Code:
cd "C:\Program Files\MySQL\MySQL Server 5.6\bin"
or
cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"
  • After that you have to execute below command to restore your database.
Code:
mysql -u [username] –p [database_name] < [dump_file.sql]
Here you have to replace “database_name” to your newly created database in which you want to restore your database.
  • At last enter your details like username and password.
 
Top