How to import database using CMD (Command Prompt)

1) Create Database

2) Copy SQL file to folder

3) Open CMD(Command prompt)

4) Result

1) Create Database

Open XAMPP and start apache server and MySQL server. If you're using WAMP then start WAMP server. Open phpMyAdmin and create a new database.

2) Copy SQL file to folder

If you're using WAMP then copy your SQL file to wamp > bin > mysql > mysql5.7.36 > bin directory and if you're using XAMPP then copy your SQL file to xampp > mysql > bin directory.

3) Open CMD(Command prompt)

Open CMD (Command Prompt). Now navigate to wamp > bin > mysql > mysql5.7.36 > bin directory for XAMPP navigate to xampp > mysql > bin directory.

Then run the following command -

mysql -u {database username} -p {database name} < database_file.sql

If you've given the database user a password, type it; otherwise, Press enter.

4) Result

To check whether tables were imported, open phpMyAdmin and choose the database.

Comments

  1. Thanks bro, I found way to import large database to my phpmyadmin.

    ReplyDelete
  2. thank you its working.

    ReplyDelete
  3. Thank you for your assistance in successfully importing a large database into phpMyAdmin.

    ReplyDelete

Post a Comment