Change the Mysql root Password from null to 123456 and root123456

Source: Internet
Author: User

Change the Mysql root Password from null to 123456 and root123456

After using mysqladminmysqladmin-u root-p password mypasswd to enter this command, enter the original root password (empty) and change the root password to mypasswd.

[Work @ master bin] $ mysqladmin-u root password 123456

[Work @ master bin] $

After the above command is executed, the second action is blank, which indicates that your password has been updated successfully.

The root password is set to 123456.


How can I change the root password of mysql?

Step 1: log on to MYSQL
Mysql-u root-p
Then press enter to enter (equivalent to entering with a blank password)
Step 2:
Use mysql;
Update user set password = password ('new password') where user = 'root ';
In this step, the password is updated.
Step 3:
Flush privileges;
Refresh permission.

OK. modified.
 
Password problem in linux: I have changed the root password 123456. you can log on again and enter 123456 again. The MYSQL password error is returned:

1. update the password should be a hash value.
MySQL> update user set password = password ('000000') where user = 'root ';

2. set to modify the mysql Hash Password
MySQL> set password for 'root' @ 'localhost' = PASSWORD ('123 ');

3. Run the mysqladmin command to change the password.
Shell> mysqladmin-uroot-poldpassword password 123456;

4. Set the password when using grant or create user
MySQL> grant all privileges on db01. * to user01 @ "localhost" Identified by "newpassword ";
MySQL> create user 'newuser' @ 'localhost' identified by 'newpass ';

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.