MySQL is a real multi-user, multi-thread SQL database server. MySQL is implemented in a Client/Server structure, which is guarded by a server Program Mysqld is composed of many different client programs and libraries. Because of its open source code and stability, and its perfect combination with the popular website programming language PHP, many websites now use it as a back-end database, making it widely used. 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: Generally, you need to have the root permission in MySQL to change the MySQL password. In this way, you cannot change the password unless you ask the Administrator to help you modify the password.
Method 1
Using phpMyAdmin (a graphical MySQL database management tool) is the simplest. You can directly use SQL statements to modify the user table of the MySQL database, but do not forget to use the password function to insert the user using the INSERT command, modify the user's use of the update command and delete the use of the DELETE command. This section describes the user field of a data table.
Method 2
Use mysqladmin. Input:
Mysqladmin-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 mysqladmin cannot connect to MySQL server, or you cannot execute mysqladmin, this method is invalid, and mysqladmin cannot clear the password.
The following methods are used at the MySQL prompt and must have the root permission of MySQL:
Method 3
MySQL "gt; insert into MySQL. user (host, user, password) values ('%', 'system', password ('manager'); MySQL "gt; 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 "gt; replace into mysql. User (host, user, password) values ('%', 'system', password ('manager'); MySQL" gt; flush privileges
Method 5
Use the SET Password statement
MySQL "gt; Set password for system @" quot; % "quot; = PASSWORD ('manager ');
You must also use the password () function, but do not need to use flush privileges for confirmation.
Method 6
Use the grant... identified by statement to grant permissions.
MySQL "gt; grant usage on *. * to system @" quot; % "quot; 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 and automatically interpret them in MySQL.
ZZ: http://blog.csdn.net/onlyzhangqin/archive/2008/09/04/2879498.aspx