What does the MySQL password forget?

Source: Internet
Author: User

1. Stop the MySQL service

[Email protected] data]#/etc/init.d/mysqld stopshutting down MySQL. success!

2. Use--skip-grant-tables to start MySQL, ignoring authorization login verification

[[email protected] data]# mysqld_safe--skip-grant-tables--user=mysql >/dev/null 2>&1&[1] 30246

3. Log in to MySQL, repair root password

[[email protected] data]# mysql mysql> updatemysql.user SET password=password ("123") WHERE user= ' root ' andhost= ' localhost '; Query OK, 0 rows Affected (0.00 sec) rows matched:1 changed:0 warnings:0 mysql>flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> Quitbye

4. Log out of MySQL and restart MySQL

[Email protected] data]#/etc/init.d/mysqld stopshutting down MySQL. success! [1]+ done Mysqld_safe--skip-grant-tables--user=mysql >/dev/null 2>&1[[email protected] Data ]#/etc/init.d/mysqld startstarting MySQL. success!


What does the MySQL password forget?

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.