Import data from SQL file to Xampp database using command line

Import data from SQL file to Xampp database using command line in windows 10

Posted by Luke Beeno on October 11, 2022

Import data from SQL file to Xampp database using command line

Import data from SQL file to Xampp database using command line in windows 10

Posted by Luke Beeno on October 11, 2022

In order to insert data from .sql file to Xampp database in Windows 10 you have to:

1. Open command line and cd to mysql directory in xampp directory

C:\xampp\mysql\bin>

2. Then run command below:

mysql -u root -p nameofdatabase < C:\xampp\htdocs\nameoffile.sql

Put your password after -p if you have a password and if your username is different to root put your username after -u.