Xampp default mysql database root password change _ MySQL

Source: Internet
Author: User
Xampp default mysql database root password change XAMPP

Because the default user root password for mysql after xampp is empty, for example, the database password must be provided when Testlink is deployed. in this case, you need to set the password for the root user (some methods on the Internet are similar, however, the key points may not be marked, and some children's shoes are unsuccessful ).

Two methods are introduced as follows:

Method 1: Use phpmyadmin

Xampp is also managed through phpmyadmin, so we can log on to phpmyadmin, enter http: // localhost/phpmyamdin in the browser address to enter the database control panel, and then select mysql database name ,, we can see that the passwords of the two root users in the user table are empty.

You can manually edit the password of the root user in the database. Click "edit" or "edit" to edit the password. for example, if the password is 123456, enter "* 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9" (excluding quotation marks)

Note: do not directly write the password 123456. it must be encrypted. this is also the reason why many children's shoes fail.

As shown in figure

Of course, you can also directly execute the SQL statement to change the password and change new_password to your own password:

1

UPDATE user SET password=password('new_password') WHERE user='root';

For example:UPDATE user SET password=password('123456') WHERE user='root';

In addition, since the mysql root user password has been modified, the corresponding password configuration in phpmyadmin should also be modified. find the configuration file, as shown in my example:
F:/xampp/phpMyAdmin/config. inc. php
Find the following code:

1

2

3

4

5

6

$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;

Change

1

2

3

4

5

6

$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, if you do not change this database, it will also work as usual, but phpmyadmin is a database management program. we will use it to create and manage databases. if you do not modify the config. inc. in the php file, phpmyadmin cannot open the page.

Method 2: Enter the bin directory to access the mysql database.



In this case, exit the command line and restart the mysql service (xampp pane stop and start can be used). use mysql-u root-p to verify that the password can be logged on.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.