Top-level solution for modifying the password of a MySQL database server

Source: Internet
Author: User

The following articles mainly introduce the correct operation scheme for modifying the password of the MySQL database server. In this article, we list a total of 6 useful solutions, if you are interested in the actual operation solution for modifying the password of the MySQL database server, the following article will satisfy your curiosity.

Method 1

Phpmyadmin is the simplest. Modify the user table of the MySQL database,

But don't forget to use the PASSWORD function.

Method 2

Use MySQLadmin, which is a special case stated above.

MySQLadmin-u root-p password mypasswd

After entering this command, you need to enter the original root password, and then the root password will be changed to mypasswd.

Change the root in the command to your username, and you can change the password of your MySQL database server.

Of course, if your MySQLadmin cannot connect to MySQL server, or you cannot execute MySQLadmin,

This method is invalid. In addition, MySQLadmin cannot clear the password.

The following methods are used at the MySQL prompt and must have the root permission of MySQL:

Method 3

 
 
  1. MySQL> INSERT INTO MySQL.user (Host,User,Password) VALUES(%,jeffrey,PASSWORD(iscuit)); mysql> FLUSH PRIVILEGES 

Specifically, this is adding a user with the username jeffrey and the MySQL database server password biscuit. I wrote this example in mysql Chinese reference manual. Be sure to use the PASSWORD function, and then use flush privileges.

Method 4

Similar to method Sany, but the REPLACE statement is used.

 
 
  1. mysql> REPLACE INTO mysql.user (Host,User,Password) VALUES(%,jeffrey,PASSWORD(iscuit)); mysql> FLUSH PRIVILEGES 

Method 5

Use the set password statement,

 
 
  1. mysql> SET PASSWORD FOR jeffrey@"%" = PASSWORD(iscuit); 

You must also use the PASSWORD () function,

However, you do not need to use flush privileges.

Method 6

Use the GRANT... identified by statement

 
 
  1. mysql> GRANT USAGE ON *.* TO jeffrey@"%" IDENTIFIED BY iscuit 

Here, the PASSWORD () function is unnecessary and does not need to be flush privileges.

Note: PASSWORD () [not] implements PASSWORD encryption in the same way as Unix PASSWORD encryption.

The above content is an introduction to the correct operation solution for modifying the password of the MySQL database server. I hope you will have some gains.

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.