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.
Access MySQL Command Line in XAMPP Or XLMPP for that matter There are two ways to do it. Both are basically the same, but one just makes it a lot easier. XAMPP - Replacing MariaDB with MySQL. As of XAMPP 5.5.30 and 5.6.14, XAMPP ships MariaDB instead of MySQL. MariaDB is not 100% compatible with MySQL and can be replaced with the 'orginal' MySQL server. Backup the old database into a sql dump file; Stop the MariaDB service; Rename the folder: c: xampp mysql to c: xampp mariadb; Installation. First you need to install XAMPP on your Windows PC. You can install MySQL alone if you want, but I shall recommend XAMPP for a better and easier usage. Simply follow the previous post to install it. Also Note down the installation directory.
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:xamppmysqlbin>' Folder and login using root use like this:
Xampp Mysql Command Line Mac
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;
Xampp Cmd Mysql Commands
output: database changed
Xampp Cmd Mysql Import
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:xamppmysqlbin>' Folder and login using root use like this:
Xampp Mysql Command Line Mac
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;
Xampp Cmd Mysql Commands
output: database changed
Xampp Cmd Mysql Import
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.