Reset the MySQL root Password in Linux

Source: Internet
Author: User

1. Stop the MySQL Service

Run:/etc/init. d/mysql stop, not necessarily/etc/init on your machine. d/mysql may also be/etc/init. d/mysqld 2. skip verification to start MySQL/usr/local/mysql/bin/mysqld_safe -- skip-grant-tables>/dev/null 2> & 1 & note: if the location of mysqld_safe is different from above, you need to change it to yours. If you are not clear about it, you can use the find command to find it. 3. Reset the password for a while, and then run:/usr/local/mysql/bin/mysql-u root mysql. After the mysql prompt appears, enter: update user set password = Password (password to be set) where User = root; press enter and run: flush privileges; refresh the table related to MySQL system permissions. Run exit. 4. Restart MySQL to killall MySQL process. Restart MySQL:/etc/init. d/mysql 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.