The first thing to declare is that in most cases, MySQL needs to have root privileges in MySQL, so the general user cannot change the password unless the administrator is requested.
method to use phpMyAdmin, this is the simplest, modify the MySQL Library user table, but do not forget to use the password function.
Method two uses mysqladmin, which is a special case of the previous declaration. Mysqladmin-u root-p Password mypasswd input This command, you need to enter the original root password, and then the root password will be changed to MYPASSWD. Change the command root to your username, and you can change your password. Of course, if your mysqladmin is not connected to MySQL server, or you do not have the means to execute mysqladmin, then this method is ineffective. And mysqladmin can't empty the password. The following methods are used at the MySQL prompt and must have the root permissions of MySQL:
Method three mysql> INSERT into Mysql.user (Host,user,password) VALUES ('% ', ' Jeffrey ', Password (' biscuit ')); Mysql> FLUSH Privileges Exactly this is adding a user, the user name is Jeffrey, the password is biscuit. There is this example in the MySQL Chinese reference manual, so I wrote it. Note that you want to use the password function, and then use flush privileges.
Method IV and method Three, just using the Replace statement mysql> replace into Mysql.user (Host,user,password) VALUES ('% ', ' Jeffrey ', Password (' Biscuit ')); Mysql> FLUSH Privileges
Method v uses the SET PASSWORD statement, mysql> set PASSWORD for jeffrey@ "%" = PASSWORD (' biscuit '); You must also use the password () function, but you do not need to use flush privileges.
Method VI using Grant ... Identified by statement mysql> GRANT USAGE on *.* to jeffrey@ "%" identified by ' biscuit '; Here the password () function is unnecessary and does not require the use of flush privileges. Note: PASSWORD () [is not] the password encryption is performed in the same way as the UNIX password encryption.