How do I change the root password of MySQL in xampp?

Source: Internet
Author: User
Tags mysql in

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 (for example: the native MySQL password is 123456), use the "mysqladmin" command in the console. For example:

d:\PHP\xampp\mysql\bin\mysqladmin.exe-u root Password 123456

In addition, if there is a previous secret, the Modify command is:

D:\PHP\xampp\mysql\bin\mysqladmin.exe-u root-p Password 123456

Enter the password, enter the "old password" can be.

Note that after you change the root password, do not forget to change the information in the PHPMyAdmin. Search for "config.inc.php" under ... xamppphpmyadmin 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.

The new password will take effect after restarting the MySQL service!

Reference:

<?php$cfg[' blowfish_secret ' = ' a8b7_snsgou.com_c6d ';/* Servers configuration */$i = 0;/* server:localhost [1] */$i + + $cfg [' Servers '] [$i] [' verbose '] = ' localhost ', $cfg [' Servers '] [$i] [' host '] = ' localhost '; $cfg [' Servers '] [$i] [' Port ' ] = "; $cfg [' Servers '] [$i] [' socket '] = '; $cfg [' Servers '] [$i] [' connect_type '] = ' TCP '; $cfg [' Servers '] [$i] [' extension '] = ' mysqli '; $cfg [' Servers '] [$i] [' auth_type '] = ' cookie '; $cfg [' Servers '] [$i] [' allownopassword '] = false;

How do I change the root password of MySQL in xampp?

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.