How to import database using CMD or SSH. - Magesan

How to import database using CMD or SSH.

How to import database using CMD or SSH.

Importing database is an essential part of our daily working need with computers.

In localhost or even on live server. This command can be used anywhere for Importing database.

  1. In localhost or say xampp, you can follow this command in CMD by going in the path given below.

Go to the => xampp/mysql/bin

Inside above path in cmd and perform below command for importing database.

mysql -u root -p database_name < C:\Users\root\Downloads\importeddb.sql

This takes usually 2 to 3 minutes for importing the database depending the size of your database. After successfully performed above command you can check inside your downloaded folder (I gave the path for downloaded folder there, you can give whatever path where you can check).

2. In live server using ssh you can use following command

find you root directory path perform this command.

mysql -u root -p database_name < D:\test.sql

That’s it. Your database imported now and use it with your needs.

Leave a Reply

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

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>