Find the installation location of XAMPP, here is my example: C:\xampp
So the path to MySQL: C:\xampp\mysql
Path to PhpMyAdmin: C:\xampp\phpMyAdmin
Modify MySQL password first step:
Turn off the MySQL service (stop) through the XAMPP Control Panel (XAMPP).
Step Two:
Open command line terminal, switch to directory: C:\xampp\mysql\bin
c:\windows\system32>cd C:\xampp\mysql\binC:\xampp\mysql\bin>mysqld--skip-grant- Tables2018----------:4200 10.1. + 5716 ...
After entering the command, the window will go into a state that cannot be manipulated, and MySQL will also start, keeping the command Line Terminal window in state and not shutting it down.
Step Three:
Open another command-line terminal and switch to directory: C:\xampp\mysql\bin
Enter the following command in turn:
C:\xampp\mysql\bin>Mysql.exe- u root # login Welcome to the MariaDB monitor with root user . Commands End With; or \g.your MariaDB connectionIDIs2Server Version:10.1. +-MariaDB mariadb.org binary distributioncopyright (c) -, ., Oracle, MariaDB Corporation Ab and others. Type'Help ;'Or'\h' forHelp. Type'\c'ToClearThe current input statement. MariaDB [(none)]> use MySQL # using MySQL database changedmariadb [MySQL]>Update user Set Password=password ('root') where user='root' ; # Change Password Query OK,0Rows affected,3Warnings (0.00sec) Rows matched:3Changed:0Warnings:3MariaDB [MySQL]> flush Privileges; # Refresh Permissions Query OK,0Rows affected, AWarnings (0.02Sec
This allows us to successfully modify the MySQL password, which is set to root, but we also need to modify the phpMyAdmin configuration file in the database connection password to ensure that the database can be connected properly.
Modifying the phpMyAdmin configuration file
Modify the password that you want to set in C:\xampp\phpMyAdmin\config.inc.php.
$cfg ['Servers'] [$i] ['password'Root ';
Restart the MySQL service and you will be able to use the password for the new settings.
Xampp reset MySQL password