How does the MySQL database password change?

Source: Internet
Author: User

Workaround:

Method OneWith phpMyAdmin, this is the simplest, modify the user table of the MySQL library, but don't forget to use the password function.
Method TwoUsing Mysqladmin, this is a special case of the preceding declaration. Mysqladmin-u root-p Password mypasswd Enter this command, you need to enter the root of the original password, and then the root password will be changed to MYPASSWD. Change the root of the command to your username, and you can change your own password. Of course if your mysqladmin is not connected to MySQL server, or you have no way to execute mysqladmin, then this method is invalid. And mysqladmin can't erase the password. The following methods are used at the MySQL prompt and must have root permissions for MySQL.
Method ThreeMysql> INSERT into Mysql.user (Host,user,password) VALUES (\%,jeffrey,password (biscuit)); Mysql> FLUSH Privileges This is exactly the addition of a user, the username is Jeffrey, and the password is biscuit. Note that you want to use the password function, and then you also use the flush privileges.
method FourAs with method Three, just use the Replace statement mysql> replace into Mysql.user (Host,user,password) VALUES (\%,jeffrey,password (biscuit)); Mysql> FLUSH Privileges
Method FiveUse the Set PASSWORD statement,mysql> set PASSWORD for [email protected] "%" = PASSWORD (biscuit); You must also use the PASSWORD () function, but you do not need to use flush privileges.
Method SixUse Grant ... Identified by statement mysql> GRANT USAGE on * * to [email protected] '% ' identified by biscuit; here the password () function is unnecessary and does not need to use flush privileges.
Note: After modifying the database password, do not forget to also modify the forum system data directory under the configuration file sql_config.php.

How does the MySQL database password change?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.