As we all know the xampp is most popular tool at machine level programming work, but sometime we need to deal with the bigger databases to import into mysql of xampp that provide and we import that using user interface then we will fail or not properly imported, I personally faced that issue many times so I just use the command prompt, because it is fastest way to do any task in any any operating systems.
For Importing database using xampp mysql, just follow the simple steps below, its quiet easy to do -
1) First, open the command prompt of windows using WIN+R key, and write CMD on RUN to open it, or you can use anyway you want.
2) Now you need to know where your xampp installed, For my case its on D:\xampp Directory of windows
3) Now navigate to "D:\xampp\mysql\bin>" Folder and login using root use like this:
mysql -u root -p
it will ask for that password, so hit enter again and you will see the mysql prompt like below image
Now if you want create database, create by using command
CREATE DATABASE my_db;
to show all list of databases, use that command
SHOW DATABASES;
it will bring up list of all databases, now you select one database you want to import using
USE my_db;
output: database changed
now database it selected, import using source command
SOURCE ./path/to/sqlfile/my_db.sql;
once process completed database is imported. Now you can use it however you want.
- Log in to post comments