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
- 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
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
- 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
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.
Note: Click on “ok” for all windows/pop box (3 windows/pop-box including this)
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.