Mysql modified password method summary

zhaozj2021-02-11  178

First, in most cases, modifying mysql is required to have root permissions in MySQL, so general users cannot change the password unless the administrator is requested. Methods One using phpmyadmin, this is the easiest, modify the User table of the MySQL library, but don't forget to use the Password function. Method 2 uses mysqladmin, which is a special case of the previous declaration. Mysqladmin -u root -p password mypasswd Enter this command, you need to enter the original password of the root, and then the root's password will be changed to mypasswd. Change the root in the command to your username, you can change your own password. Of course, if your mysqladmin connection is not mysql server, or you have no way to execute mysqladmin, then this method is invalid. And mysqladmin cannot empty your password. The following method is used in the MySQL prompt, and must have a mysql root permission: Method 3 mysql> INSERT INTO mysql.user (Host, User, Password) Values ​​('%', 'Jeffrey', Password ('Biscuit' )))); mysql> Flush privileges is exactly that this is increasing a user, the username is Jeffrey, the password is Biscuit. There is this example in the "MySQL Chinese Reference Manual", so I will write it. Note To use the Password function, then use Flush Privileges. Methods 4 and Methods, like the three, just use the Replace statement mysql> Replace Into mysql.user (Host, User, Password) VALUES ('%', 'Jeffrey', Password ('Biscuit')); mysql> Flush Privileges method 5 Use the set password 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'; here the password () function is unnecessary, nor does it need to use Flush Privileges. Note: Password () [is not] The password encryption is applied to the same method encrypted at UNIX password.

转载请注明原文地址:https://www.9cbs.com/read-4826.html

New Post(0)