Reset the MySQL password in Linux

Source: Internet
Author: User

Resetting the MySQL password in Linux according to relevant information, there are usually not many passwords that can be remembered. In many cases, the password can be set with multiple accounts and passwords. However, the password of an account that is frequently accessed will not be forgotten. However, when you forget the MySQL password, the following describes how to forget the MySQL password in Linux. In fact, it is very simple. It only takes six steps to solve the problem. Don't talk about it. Let's go to the topic: www.2cto.com 1. Shut down the MySQL service: service mysqld stop 2. Execute the following command to exit the security mode. Of course, this command is only valid when localhost is used. /Usr/local/mysql/bin/mysqld_safe-skip-grant www.2cto.com 3. Enter MySQL/usr/local/mysql/bin/mysql-u root-p to enter mysql 4. Change the password, run the following statement: use mysql; UPDATE user SET Password = password ("XXX") WHERE User = "root"; where xxx is the Password you want to SET, flush privileges; exit; 5. Remove the skip-grant in the configuration file and modify the configuration file. The configuration file in linux is my. cnf. The configuration file in windows is my. ini, add skip-grant 6 under [mysqld], start MySQL service: service mysqld start

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.