How to change the default mysql null password (root password) in xampp

Source: Internet
Author: User

I have referred to some methods provided on the Internet and found that they are quite complicated. We will share with you a simple and quick method.

First, the mysql user information is saved in the user table of the mysql database, and the Password field of the table is encrypted and stored using the PASSWORD method.

Once you understand the preceding prompts, you can simply change the password and run the following SQL statement (change the password to jb51.net here ):

Copy codeThe Code is as follows:
UPDATE user SET password = PASSWORD ('jb51. net') WHERE user = 'root ';



After the above operations, the password is changed.

If you want to directly enter localhost/phpMyadmin and go to the phpMyadmin management interface without entering the user name and password, perform the following operations:

Find the phpMyadmin configuration file, that is, config. inc. php under the phpMyAdmin directory, and find the following code:

Copy codeThe Code is as follows:
/* Authentication type and info */
$ 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;

Copy codeThe Code is as follows:
/* Authentication type and info */
$ Cfg ['servers'] [$ I] ['auth _ type'] = 'config ';
$ Cfg ['servers'] [$ I] ['user'] = 'root ';
$ Cfg ['servers'] [$ I] ['Password'] = 'jb51. net ';
$ Cfg ['servers'] [$ I] ['extension'] = 'mysql ';
$ Cfg ['servers'] [$ I] ['allownopassword'] = true;

Related Article

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.