MySQL password change solution Summary

Source: Internet
Author: User
With the wide application of MySQL databases, changing MySQL passwords also emerges. We all know that MySQL passwords often need to be modified in practical applications, the following articles mainly describe the summary of the MySQL password change solution. I hope you will get some benefits. MySQL (the best combination with PHP) is a real multi-user, multi-thread SQL database server.

With the wide application of MySQL databases, changing MySQL passwords also emerges. We all know that MySQL passwords often need to be modified in practical applications, the following articles mainly describe the summary of the MySQL password change solution. I hope you will get some benefits. MySQL (the best combination with PHP) is a real multi-user, multi-thread SQL database server.

With the wide application of MySQL databases, changing MySQL passwords also emerges. We all know that MySQL passwords often need to be modified in practical applications, the following articles mainly describe the summary of the MySQL password change solution. I hope you will get some benefits.

MySQL (the best combination with PHP) is a real multi-user, multi-thread SQL database server.

MySQL (the best combination with PHP) is implemented in a Client/Server structure, which is composed of a server daemon MySQL (the best combination with PHP) d and many different customer programs and libraries. Because of its openness and Stability of the source code, and with the popular website editing? Swing? The perfect combination of PHP is now widely used by many sites as backend databases.

In terms of security, each user must be given access restrictions on different databases to meet the requirements of different users. We will discuss it separately for your reference.

I. Summary of MySQL password change methods

The first thing to note is that, in general cases, modifying the password of MySQL (the best combination with PHP) requires the root permission in MySQL (the best combination with PHP, in this case, the user cannot change the password unless the Administrator is requested to help modify the password.

Method 1

Using phpMyAdmin (a graphical tool for managing MySQL databases (the best combination with PHP) is the simplest. You can directly use SQL statements to modify MySQL (the best combination with PHP) the user table of the database, but do not forget to use the PASSWORD function to Insert the user using the Insert command, modify the user using the Update command, and Delete the user using the Delete command. This section describes the user field of a data table.

Method 2

Use MySQL (the best combination with PHP) admin. Input

MySQL (best combination with PHP) admin-u root-p oldpassword newpasswd

After executing this command, you need to enter the original root password, so that the root password will be changed to newpasswd. Similarly, change the root in the command to your username, and you can change your password. Of course, if your MySQL (the best combination with PHP) admin cannot connect to MySQL (the best combination with PHP) server, or you cannot execute MySQL (the best combination of PHP and MySQL) admin. This method is invalid, and MySQL (the best combination of PHP and MySQL) admin cannot clear the password.

The following methods are used at the MySQL (the best combination with PHP) prompt, and must have the root permission for MySQL (the best combination with PHP:

MySQL password change method 3

MySQL (the best combination with PHP)> insert into MySQL (the best combination with PHP ). user (Host, User, Password) VALUES ('%', 'system', PASSWORD ('manager '));

MySQL (best combination with PHP)> FLUSH PRIVILEGES

Specifically, this is to add a user with the username system and Password manager. Be sure to use the PASSWORD function, and then use flush privileges for confirmation.

Method 4

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

MySQL (the best combination with PHP)> replace into MySQL (the best combination with PHP). user (Host, User, Password)

VALUES ('%', 'system', PASSWORD ('manager '));

MySQL (best combination with PHP)> FLUSH PRIVILEGES

Method 5

Use the set password statement

MySQL (best combination with PHP)> set password for system @ "%" = PASSWORD ('manager ');

You must also use the PASSWORD () function, but do not need to use flush privileges for confirmation.

MySQL password change method 6

Use the GRANT... identified by statement to GRANT permissions.

MySQL (best combination with PHP)> grant usage on *. * TO system @ "%" identified by 'manager ';

Here, the PASSWORD () function is unnecessary and you do not need to use flush privileges for confirmation.

Note: The PASSWORD () function is used to encrypt passwords. MySQL (the best combination with PHP) is automatically interpreted in the program.

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.