How to Import Database Dump in MySQL ?

Before Import any database dump into MYSQL server, need to make sure that database and user are created.

We can create database and account using below command on Terminal.

d@MacBook-Air % /usr/local/mysql-8.0.30-macos12-x86_64/bin/mysql -u root -p
Enter Password -> Type root password
mysql> create database db2005;
mysql> create user ‘admin1’@’localhost’ identified by ‘db123’;
mysql> grant all on db2005.* to ‘admin1’@’localhost’;
mysql> exit

Use below command to import database.

d@MacBook-Air platform % /usr/local/mysql-8.0.30-macos12-x86_64/bin/mysql -u admin1 -p db2211 < db2211.sql

 

Leave a Comment

Your email address will not be published. Required fields are marked *