How to Restore Database in MY SQL Easy

To restore Database in MY SQL there are different ways to restore database in my SQL.

Restore database using CMD.

how to Restore database in Command prompt CMD

To restore my SQL database using command prompt follow the below steps.

Step 1. Open CMD and Go to the path where your MY SQL Server is installed e.g.

C:\Program Files\MySQL\MySQL Server 5.7\bin

C:\Program Files\MySQL\MySQL Server 5.7\bin

To go above path Open CMD and type cd.. two times to go C: path and then type cd ‘your path’ e.g. cd Program Files\MySQL\MySQL Server 5.7\bin

my sql installed path

MySQL

https://www.mysql.com/

Step 2. Type below restore script for my SQL restore.

MySQL DB restore command.

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -h localhost -u root -proot databsename <d:databasename.sql
my sql restore cmd

Step 3. Enter Your Username and password and set path where your backup file is located. here my backup file was in D: path.

How to restore database in sql server

Note that my sql default user is root you can add your new user as per your requirement.

Here, localhost is your server local you can enter host name or ip address of you My SQL server machine instead of localhost, -u is for username of my SQL server and ‘-p’ is for password of you my SQL server.
In this restore script, I have used ‘root’ for both username and password,my sql user name is ‘root’ and password is ‘root’.
here you need to change your SQL username and password. Here my username and password both are same i.e. root,

Step 4. After restore script Click Enter button your database will restored successfully.

FAQ Restore MY SQL

Q. How to restore database in my SQL.

Ans: To restore database in my SQL you need SQL data and schema script or database backup, then you can restore my SQL database using different ways like using cmd, or you can import database in PhpMyAdmin panel.

Q. What is default user of my SQL database.

Ans: Default user of my SQL database is ‘root’. you can create user in my SQL as per your requirement.

how to create user in sql server

Q. what is Default port of My SQL

Ans: Default port of my SQL server is. 3306

How to Change SQL Server Port

Q. How to backup database

Ans: Click here for tutorial How to backup database in SQL.

Q. My SQL Restore Command

Ans : mysql -h localhost -u root -proot databsename <d:databasename.sql