Simple Method for changing the root password of Mysql

Source: Internet
Author: User
There are many ways to change the mysql password. If you have a blank password, you cannot use phpmyadmin to log on. We can only use command mode to operate.

There are many ways to change the mysql password. If you have a blank password, you cannot use phpmyadmin to log on. We can only use command mode to operate.

You can use the Mysql update command to modify the old root password or set the root password to null. If you use the update command to change the root password, you need to use the built-in Mysql encryption function PASSWORD (string), which is used to encrypt a plaintext PASSWORD and cannot be decrypted. set the password in the user (user permission table)

Use the update command to change the root password as follows:

The Code is as follows:

Mysql> use mysql

Database changed

Mysql> update user set password = PASSWORD ('000000') where user = 'root ';

Query OK, 0 rows affected (0.00 sec)

Rows matched: 1 Changed: 0 Warnings: 0

Mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

In this case, download and modify the password.

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.