Because the password for the MySQL default user root after installing xampp is empty, such as the need to provide a database password when deploying Testlink, you need to set a password for root (there are some methods on the web that are similar, but may not indicate the key points , Not a few of the children's shoes were unsuccessful.
Here are two ways to do this:
Method One: Through phpMyAdmin
XAMPP is also managed through phpMyAdmin, so we can log in to phpMyAdmin, enter Http://localhost/phpmyamdin into the database Control Panel on the browser address, and then choose the name MySQL database, You can see from the user table that the password for root two users is empty.
We can manually edit the root user's password in the database. Click Quick Edit, or edit can edit password, such as password: 123456, then fill in "*6bb4837eb74329105ee4568dda7dc67ed2ca2ad9" (except quotation marks)
Note: Do not write the password directly 123456. Be sure to encrypt it, which is why a lot of children's shoes are unsuccessful.
After editing as
Of course, you can also directly execute SQL statements to modify the password, the new_password to their own password can be:
1 |
UPDATE user SET password=password( ‘new_password‘ ) WHERE user= ‘root‘ ; |
Such as:
UPDATE user SET password=password(
‘123456‘
) WHERE user=
‘root‘
;
In addition, since MySQL root user password has been modified, then the corresponding password configuration in the phpMyAdmin also to modify, find the configuration file, such as mine is:
F:\xampp\phpMyAdmin\config.inc.php
Find the following code
123456 |
$cfg [ ‘Servers‘ ][ $i ][ ‘auth_type‘ ]= ‘config‘ ; $cfg [ ‘Servers‘ ][ $i ][ ‘user‘ ]= ‘root‘ ; $cfg [ ‘Servers‘ ][ $i ][ ‘password‘ ]= ‘‘ ; $cfg [ ‘Servers‘ ][ $i ][ ‘extension‘ ]= ‘mysql‘ ; $cfg [ ‘Servers‘ ][ $i ][ ‘AllowNoPassword‘ ]= true; |
Revision changed to
123456 |
$cfg [ ' Servers ' [ $i ] ' auth_type ' ]= ' config ' ; $cfg [ ' Servers ' [ $i ] ' user ' ]= ' root ' ; $cfg [ ' Servers ' [ $i ] ' password ' ]= ' 123456 ' ; $cfg [ ' Servers ' [ $i ] ' extension ' ]= ' mysql ' ; $cfg [ ' Servers ' [ $i ] ' Allownopassword ' ]= true; |
Of course, you do not change the database will work as usual, but phpMyAdmin is a database management program, we use it to create a management database, and so on, if you do not modify the contents of the config.inc.php file, phpMyAdmin cannot open the page.
Method Two: Enter the MySQL database by entering the bin directory
This is done, exit exit the command line and restart the MySQL service (can be xampp pane stop and start), use Mysql-u root-p to try the password to log in
Xampp default MySQL database root password modification