Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Log in to mysql and report to ERROR 1045 (28000): Access denied solution

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Reason why the system reported an error when logging in to mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

The first reason may be that the password was really typed incorrectly.

The second reason is that there is a problem during installation, for example, the data directory may not be available.

Solution:

1 there is no data directory command to create

Mysqld-initialize-insecure-user=mysql

2 NET stop mysql57

3 mysqld-- defaults-file= "C:\ Program Files\ MySQL\ MySQL Server 5.7 my-default.ini"-- console-- skip-grant-tables

Another window executes mysql-u root-p to enter the console directly.

4 use mysql

5 change password

Update user set password=PASSWORD ('12345') where USER='root';// prior to version 5.7

Update mysql.user set authentication_string=password ('oracle') where user='root' and Host =' localhost'

Flush privileges;//5.7 version

6 View users

SELECT User, Host,authentication_string FROM mysql.user

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report