First, you must declare that, in most cases, modifying MySQL requires the root permission in mysql. Therefore, you cannot change the password unless you request the administrator. Method 1: Use phpmyadmin, which is the simplest. modify the user table of the mysql database, but do not forget to use the PASSWORD function. Method 2: Use mysqladmin, which is previously stated "> <LINKhref
First, you must declare that, in most cases, modifying MySQL requires the root permission in mysql. Therefore, you cannot change the password unless you request the administrator.
Method 1: Use phpmyadmin, which is the simplest. modify the user table of the mysql database, but do not 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, enter the original root password and change the root password to mypasswd. Change the root in the command to your username, and you can change your password. Of course, if your mysqladmin cannot connect to mysqlserver, 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: mysql> insert into mysql. user (Host, User, Password) VALUES ('%', 'Jeffrey ', PASSWORD ('biscuit'); mysql> FLUSHPRIVILEGES is adding a user, the user name is jeffrey and the password is biscuit. I wrote this example in mysql Chinese Reference Manual. Be sure to use the PASSWORD function, and then use flush privileges.
Method 4 is similar to Method 3, but the REPLACE statement mysql> replace into mysql is used. user (Host, User, Password) VALUES ('%', 'Jeffrey ', PASSWORD ('biscuit'); mysql> FLUSH PRIVILEGES
Method 5 use the SETPASSWORD statement, mysql> set password for jeffrey @ "%" = PASSWORD ('biscuit'); you must also use the PASSWORD () function, but do not need to use flush privileges.
Method 6 use GRANT... identified by statement mysql> grant usage on *. * TO jeffrey @ "%" identified by 'biscuit'; 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.