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 to the 1045 error in navicat

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces the solution to the 1045 error in navicat, 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.

Problems that have occurred:

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

Cause analysis:

Mainly because the user name or password entered by the user is denied access, if you do not want to reinstall, you need to retrieve the password or reset the password.

The solution is to reset the root user password. On Windows platform, the steps are as follows:

Method 1:

1. Log in to the system as a system administrator

If the MySQL server is running, stop it.

If you are running as a Windows service, go to Service Manager: start menu-> Control Panel-> Administrative tools-> Service; if the server is not running as a service, you may need to use Task Manager to force it to stop.

Create a text file and put the following commands on a single line:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD (' MyNewPassword')

Save the file with any name. In this case, the file is C:\ mysql-init.txt.

4. Enter the DOS command prompt: start menu-> run-> cmd

Suppose you have installed MySQL to C:\ mysql. If you installed MySQL to another location, please adjust the following command accordingly.

From the DOS command prompt, execute the command:

C:\ > C:\ mysql\ bin\ mysqld-nt-- init-file=C:\ mysql-init.txt

When the server starts, execute the "--init-file" option to read the contents of the file named by the SQL command from the specified file at startup, and change the root password. When the server starts successfully, you should delete C:\ mysql-init.txt.

Stop the MySQL server and restart it in normal mode.

If you run the server as a service, you should start it from the Windows services window; if you start the server manually, you can use commands as you would normally.

Method 2:

# / etc/init.d/mysql stop# mysqld_safe-- user=mysql-- skip-grant-tables-- skip-networking & # mysql-uroot mysqlmysql > UPDATE user SET Password=PASSWORD ('newpassword') whereUSER='root';mysql > FLUSH PRIVILEGES;mysql > quit# / etc/init.d/mysql restart# mysql-uroot-pEnter password: mysql >

Method 3:

Directly use the username and password provided in the [client] section of the / etc/mysql/debian.cnf file:

# mysql-udebian-sys-maint-pEnter password: mysql > UPDATE user SET Password=PASSWORD ('newpassword') whereUSER='root';mysql > FLUSH PRIVILEGES;mysql > quit# mysql-uroot-pEnter password: mysql >

Method 4:

1. The administrator logs in to the system, stops the mysql service or ends the mysqld-nt process

2. Enter the command line and go to the installation directory of mysql. Suppose the installation directory is d:\ mysql\, and CMD enters the command line

3. Run d:\ mysql\ bin\ mysqld-nt-- skip-grant-tables to start mysql and turn off the permission check

4. Run d:\ mysql\ bin\ mysqladmin-u root flush-privileges password "newpassword" to reset the root password

5. Restart the mysql service

Thank you for reading this article carefully. I hope it will be helpful for everyone to share the solutions to the 1045 errors in navicat. At the same time, I also hope that you will 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