MySQL's second barrier

Source: Internet
Author: User

MySQL root can not reset password (improper operation caused)

/etc/my.cnf added Skip-grant-tables in safe mode password-free login no problem (MySQL library is in), and then reset the password in MySQL after the exit, will just in/etc/ MY.CNF configuration removed after restarting the MySQL service, with the correct password reset always prompt password is incorrect ... Later found not to add skip-grant-tables configuration can also be no password login mysql,show database; and the MySQL library.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/78/67/wKioL1Z7o8DSI44MAADeqmyMTmM883.png "title=" 1.png " alt= "Wkiol1z7o8dsi44maadeqmymtmm883.png"/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/78/67/wKioL1Z7o87S6nX3AABGqklv79E654.png "title=" 2.png " alt= "Wkiol1z7o87s6nx3aabgqklv79e654.png"/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/78/68/wKiom1Z7o8bi7H6mAAA6v3rU6bg568.png "title=" 3.png " alt= "Wkiom1z7o8bi7h6maaa6v3ru6bg568.png"/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/78/68/wKiom1Z7o-fiiOeLAABijwUguoY891.png "title=" 4.png " alt= "Wkiom1z7o-fiioelaabijwuguoy891.png"/>

How to change your password by forgetting your password
(1) Edit MySQL master configuration file my.cnf
# VIM/ETC/MY.CNF Add a parameter under the [mysqld] field skip-grant
(2) Restart the database service
Service mysqld Restart
(3) so you can access the database without authorization.
#/usr/local/mysql/bin/mysql-uroot
(4) modify the corresponding user password
> Use MySQL;
> Update user set Password=password (' Your password ') where user= ' root ';
> quit;

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/78/67/wKioL1Z7pILT6PlvAABFSDMk9JA560.png "title=" 5.png " alt= "Wkiol1z7pilt6plvaabfsdmk9ja560.png"/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/78/67/wKioL1Z7pJLQ-kOyAABBrlM5_7A292.png "title=" 6.png " alt= "Wkiol1z7pjlq-koyaabbrlm5_7a292.png"/>

Cause: The user table inside the MySQL library is damaged and the data is lost. Workaround: First rename the MySQL library and then reinitialize it. Reset the password again and log in and you're done.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/78/6A/wKiom1Z7sKTyODldAAAtrY0OQ5o411.png "title=" 8.png " alt= "Wkiom1z7sktyodldaaatry0oq5o411.png"/>

This article is from the "Steven Never give Up" blog, please be sure to keep this source http://wsw26.blog.51cto.com/1442148/1727940

MySQL's second barrier

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.