MySQL Change password

Source: Internet
Author: User

Steps to be made for the newly initialized database

1 password was set for root

2 Deleting the Default user

3 Delete the default test library


Ways to change passwords

1 set the password for the administrator (start without password)

Mysqladmin-uroot password ' 12qwaszx ';

2 Change Password

Method One: Mysqladmin management tools (recommended)

Mysqladmin-uroot-p ' 12qwaszx ' password ' c110123 ';

Note There are spaces (between password and the new password)

Method Two: Modify the Content field of the Mysql.user

Update Mysql.user set Password=password (' 12qwaszx ') where user= ' root ' and host= ' 127.0.0.1 ';


Frequently used scenarios: After the password is lost, the password is changed after starting the data with the--skip-grant-tables parameter

Tips:

Conditions must be specified, SQL must be skilled and cautious

You must specify the password function to encrypt the change password.

Method Three:,

Set Password=password (' 123456 ');

Change the user password that is currently logged in

This method is not suitable for password loss--skip-grant-tables after password change

Must change password after must execute flush privileges;


This article is from the "Tridewah operation and maintenance work Road" blog, please be sure to keep this source http://cuidehua.blog.51cto.com/5449828/1762142

MySQL Change password

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.