Method 1
Using phpMyAdmin, this is the easiest, to modify the MySQL library's user table,
But don't forget to use the password function.
Method 2
Using Mysqladmin, this is a special case of the previous declaration.
Mysqladmin-u root-p Password mypasswd
After entering this command, you need to enter the original password for root, 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 have no way 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 3
Mysql> INSERT into Mysql.user (Host,user,password) VALUES (%,jeffrey,password (iscuit)); Mysql> FLUSH Privileges
To be exact, this is adding a user, the username is Jeffrey, and 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 4
And method Three, just use the Replace statement
Mysql> REPLACE into Mysql.user (Host,user,password) VALUES (%,jeffrey,password (iscuit)); Mysql> FLUSH Privileges
Method 5
Using the Set Password statement,
Mysql> SET PASSWORD for jeffrey@ "%" = PASSWORD (Iscuit);
You must also use the password () function,
But you don't need to use flush privileges.
Method 6
Use Grant ... Identified by statement
Mysql> GRANT USAGE on *.* to jeffrey@ '% ' identified by Iscuit
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.