MySQL Password change

Source: Internet
Author: User

1. The user changes the password;

Method One: Mysqladmin-u user-p password password ' new password '

Mysqladmin-uroot-pdefault password ' zhouli.cn '

Method Two: Set Password=password ("New_password");

Mysql> set Password=password ("Default");

Method Three: Update Mysql.user set Password=password (' New password ') where user= ' user ' and host= ' address ';

Update Mysql.user Set Password=password ("Default") where user= ' root ' and host= ' localhost ';

Flush privileges;

2.root user modifies other user's password

Method One: Set password for user @ ' address ' =password (' new password ');

mysql> Set password for [email protected] ' localhost ' =password ("Sql_sql");

Method Two: Mysqladmin-u user-p password password ' new password '

Mysqladmin-uuser1-pzhouzhou password ' Nihao '

3. Forgot root password how to solve

1) When you turn on the MySQL service, add the--skip-grant-tables parameter

Mysqld_safe--skip-grant-tables

Mysql-uroot Direct return, then use Update to change the root password can be

Update Mysql.user Set Password=password ("Default") where user= ' root ' and host= ' localhost ';

MySQL Password change

Related Article

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.