Access Denied for user root @localhost solution

Source: Internet
Author: User

Problem Description:
C:\users\bo.wang> Mysql-u Root-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)

Steps to resolve:
Step1: Modify the MySQL configuration file my.int, add Skip-grant-tables and save.

Step2: Restart the MySQL service.

Step3: Change root password
C:\users\bo.wang>mysql

mysql> use MySQL
Database changed
mysql> Update user Set Password=password ("123456") where user= "root";
Query OK, 0 rows Affected (0.00 sec)
Rows matched:1 changed:0 warnings:0

mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)

Mysql> exit

Step4: Connect MySQL with Navicat or other visual tools to view the user table in MySQL library, modify the root user's permissions (password is encrypted, do not change)

STEP5: Re-modify My.ini, Comment skip-grant-tables command line, save restart MySQL service

Access Denied for user root @localhost solution

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.