Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import an SQL file by using mysqldump on Windows through command line

Tags:

mysql

How do I import an SQL file to MySQL dump using command line. I am using windows.

like image 681
DEVOPS Avatar asked Jan 21 '11 05:01

DEVOPS


2 Answers

Navigate to the directory where you have mysql and issue this command, changing the bold values to your file/database locations.

c:\mysql\bin\> mysql -u USERNAME -p PASSWORD database_name < filename.sql
like image 85
ayush Avatar answered Sep 27 '22 02:09

ayush


Simple steps to import sql file.

Click on WampServer and then go to MySQL=> MySQL console enter password \If no password click simply enter create database database_name; \If database already there skip this step use database_name; source D:\backup.sql \Path of database file

like image 21
Baskaran Avatar answered Sep 24 '22 02:09

Baskaran