Workaround for MySQL database report access denied for user

Source: Internet
Author: User

Log in to the MySQL database using the root user error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes).


Solution:

1. Execute command : Service mysqld stop; stop MySQL service

2. Add parameter start execution command mysqld_safe--skip-grant-tables (note: Will be stuck on the current terminal after execution)

3. Open a terminal mysql-u root; You can log in to the database.

4. Execute command : use MySQL; switch Database

5. Execute the command: Update user Set Password=password ("123456") where user= "root"; Change root password

6.flush privileges; Configuration parameters take effect

7. Exit the database; exit;

8.service mysqld start; Launch database.




This article is from the "three-pole Walker" blog, please be sure to keep this source http://namesam.blog.51cto.com/12364721/1976345

Workaround for MySQL database report access denied for user

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.