16/7/14-mysql-Modify the root password of mysql5.6 or later

Source: Internet
Author: User

Version update, the original password field in user has been changed to authentication_string

Version update, many online tutorials are not applicable, even the official website of the document is not able to operate smoothly.

If MySQL is running, first kill it:

Killall-term mysqld.

Run

Mysqld_safe--skip-grant-tables &

If you do not want to be remotely connected at this time: Mysqld_safe--skip-grant-tables--skip-networking &

Using MySQL to connect to server

Change Password:

Update Mysql.user set Authentication_string=password (' 123qwe ') where user= ' root ' and Host = ' localhost ';

* Note that there is no password field in the user table in the new MySQL database.

Instead, the encrypted user password is stored in the Authentication_string field

mysql> Flush privileges;mysql> quit;

The modification is complete. Restart

Killall-term mysqld. Mysqld_safe &

And then MySQL can connect.

But at this point the operation seems to be incomplete, but also alter user ...

Alter user ' root ' @ ' localhost ' identified by ' 123 ';

The web says Jiangzi can also:

Set password for ' root ' @ ' localhost ' =password (' 123 '); CP Mysql.server/etc/init.d/mysqlchmod +x/etc/init.d/ Mysqlchkconfig--add MySQL

16/7/14-mysql-Modify mysql5.6 or later root 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.