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

The solution of reporting error ERROR 1045 after mysql installation

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces the solution of error report ERROR 1045 after mysql installation, which has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

Solutions: 1, turn off the mysql service; 2, open a terminal to enter the database in secure mode; 3, open a new terminal, execute the "mysql-u root" command, log in to the database without a password; 4, use "alter user..." Command to change the password; 5, restart mysql.

Error reporting problem:

1. Install Mysql8.0.18 yesterday, and then use navicat to connect, and the result appears:

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

2. Then I logged in to mysql on the command line and found that it was also an error report.

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

1. Shut down the mysql service first

$sudo service mysql stop

2. Open the terminal

$cd / usr/local/mysql/bin$ sudo su

3. then execute the following command, that is, you can enter the database in safe mode

Sh-3.2#. / mysqld_safe-- skip-grant-tables &

4. Open a new terminal

$mysql-u root

Note: at this point you will find that you can access the database without a password

Modify the password

1. After entering the database safely through the above operations, perform the following operations

Mysql > use mysqlmysql > alter user 'root'@'localhost'IDENTIFIED BY' MyNewPass'

Note: the password policy restrictions above mysql8.0 must be upper and lowercase plus special numeric symbols.

Restart mysql and you will OK.

Thank you for reading this article carefully. I hope the editor will share the solution of error ERROR 1045 after mysql installation is helpful to everyone. At the same time, I also hope you can support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

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