XAMPP is a software distribution which provides the Apache web server, MySQL database, PHP or many more all in one package.it also provided PhpMyadmin which gives a GUI tool for managing your MySQL databases
You can to connect phpMyadmin to MySql command line.
We can connect PhpMyadmin to command line in 3 ways.
- XAMPP Shell
- From xampp mysql directory and open command line and use MySQL command
- Set Path XAMPP MySql path in Environment Variable.
Let’s discuss each one
Related : Download and Install XAMPP
1. XAMPP Shell
![start xampp](http://www.learnwebtech.in/wp-content/uploads/2020/07/start-xampp-server.png)
- use mysql command “mysql -uroot -p” to login into mysql, here -u for taking user name of mysql and -p for password.
- PhpMyadmin default user name is : root and password : null/nothing (blank) Note : just hit enter without entering anything
![XAMPP Mysql command line](http://www.learnwebtech.in/wp-content/uploads/2020/07/xampp-mysql-command-line-1024x589.png)
2. XAMPP Mysql directory
- Go to C:\xampp\mysql\bin or which drive you have installed xampp. Basically, you should go \xampp\mysql\bin
- type cmd, address bar
![Mysql path in xampp](http://www.learnwebtech.in/wp-content/uploads/2020/07/mysql-path.png)
- use mysql command “mysql -uroot -p” to login into mysql, here -u for taking user name of mysql and -p for password.
- PhpMyadmin default user name is : root and password : null/nothing (blank) Note : just hit enter without entering anything
![XAMPP Mysql command line](http://www.learnwebtech.in/wp-content/uploads/2020/07/mysql-command-line.png)
3. Set MySql path in environment variable
To set path of Mysql or any other application in environment variable, is very useful for application. Follow below steps to set the path.
![Search environment variable](http://www.learnwebtech.in/wp-content/uploads/2020/07/search-envirnoment-variable.png)
![Environment Variable](http://www.learnwebtech.in/wp-content/uploads/2020/07/search-envirnoment-on-click-2.png)
![Edit Environment Variable](http://www.learnwebtech.in/wp-content/uploads/2020/07/edit-environment-variable.png)
![Set MySql Path](http://www.learnwebtech.in/wp-content/uploads/2020/07/set-path.png)
Note: Click on “ok” for all windows/pop box (3 windows/pop-box including this)
![Open command prompt](http://www.learnwebtech.in/wp-content/uploads/2020/07/command-line-for-mysql.png)
![Login in mysql](http://www.learnwebtech.in/wp-content/uploads/2020/07/use-mysql-command-line-1024x692.png)
MySql Query explaination
- use mysql command “mysql -uroot -p” to login into mysql, here -u for taking user name of mysql and -p for password.
- PhpMyadmin default user name is : root and password : null/nothing (blank) Note : just hit enter without entering anything
- to create database in mysql run command create database learn_php, here learn_php is database name and create database is mysql command.
- for use of created database run command use learn_php. Here use is mysql command and learn_php is database name.
- You can create table as well insert data into created table or do many operation as per your need. e.g. select data, join, etc.