Modify MySQL default password
MySQL "root" user default state is no password, so in PHP you can use mysql_connect ("localhost", "root", "") to connect to the MySQL server;
If you want to set a password for the "root" user in MySQL, use the "mysqladmin" command in the console. For example:
Under the Windows version of XAMPP:
\...\xampp\mysql\bin\mysqladmin-u root-p Password New password
After running, you will be prompted for the old password, and if it is correct, the newly entered password will be modified immediately.
The Linux version of XAMPP is the following command:
/opt/lampp/bin/mysqladmin-u root-p Password New password
Modify phpMyAdmin's MySQL password
Note that after you change the root password, do not forget to change the information in the PHPMyAdmin. Under \...\xampp\phpmyadmin\, search for "config.inc.php" and edit the following lines:
$cfg [' Servers '] [$i] [' user '] = ' root '; MySQL SuperUser
$cfg [' Servers '] [$i] [' auth_type '] = ' http '; HTTP MySQL authentification
From now on, you need to enter the "root" password correctly to start PHPMyAdmin
Modifying the MySQL port of phpMyAdmin
If you modified the default port 3306 for MySQL, you would modify the phpMyAdmin directory under libraries under Configuration file config.default.php. $cfg [' Servers '] [$i] [' port '] = ' This comment indicates that the null representation is using the default port 3306 for MySQL. Just change it to: $cfg [' Servers '] [$i] [' port '] = ' 3307 ';
Modify the MySQL default password and port for XAMPP