A summary of the method of modifying the root password of MySQL in xampp

Source: Internet
Author: User
Tags mysql in phpmyadmin

MySQL's "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 110), use the "mysqladmin" command in the console. For example:

D:www.111cn.netxamppmysqlbinmysqladmin.exe-u Root Password 110

Note that after you change the password for root, do not forget to change the information in the phpMyAdmin. Search for "config.inc.php" under ... xamppphpmyadmin and edit the following lines:

The code is as follows Copy Code

$cfg [' Servers '] [$i] [' user '] = ' root '; MySQL Superuser
$cfg [' Servers '] [$i] [' auth_type '] = ' http '; HTTP://www.111cn.net MySQL authentification

From now on, you need to correctly enter the "root" password to start phpMyAdmin.


add other ways to modify the root password

Method 1:
Under the/usr/www.111cn.net/mysql/bin/:

The code is as follows Copy Code
./mysqladmin-u root password ' new_password '

This method is set for general installation.

Method 2:
In MySQL state:

The code is as follows Copy Code
Mysql>update user SET Password=password (' New_password ') WHERE user= ' root ';
Mysql>flush privileges;

Method 3:

  code is as follows copy code
mysql>set PASSWORD for Root=password (' New_password ');
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.