On my windows computer, I have installed the xampp with PHP version 7.4.30 and MariaDB 10.4.25. I can access localhost/phpmyadmin, but when I try to access through the command line (cmd), it shows the following error.
'mysql' is not recognized as an internal or external command,
operable program or batch file.
All you need to do is go to your MySQL bin folder. If you didn’t change the installation path during install the xampp, then it should be in c:\xampp\mysql\bin. From there, your MySQL command should work as expected.
1. Open your command prompt (cmd), then cd to the bin directory.
cd c:\xampp\mysql\bin
2. Try “mysql” or “mysql.exe”
mysql -u root --password
// or
mysql.exe -u root --password