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 when there are 10061 and 1045 errors in MySQL remote connection

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

Share

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

In the past, the management of the MySQL database is basically local, today learned that a relatively light, do not need to install, directly extract the available graphical interface management tool HeidiSQL (download address: link: http://pan.baidu.com/s/1nvuP2Et password: vry9), the interface is very simple.

1) solve the 10061 problem

When I follow the prompts to remotely connect to the MySQL database under the Linux system, the first thing I encounter is the following problems:

Figure 1: '10061' problem

As a result, according to the error code prompted to find information, many platforms on the Internet say that it is the permission problem of MySQL, and it is necessary to give sufficient permissions to root users to allow root usernames to connect to the MySQL database from a host with an IP address or any IP address.

First look up the user information in MySQL:

Select Host,User from user

The information in the user table in MySQL is as follows:

Figure 2: host permissions for the root user

As can be seen from the above figure, root users have 127.0.0.1 local connection rights and "%" permission to allow hosts with any IP address to connect to MySQL remotely, so they connect again, but still display a '10061' error, so continue to look up the information. Some netizens have informed that it is necessary to modify the configuration code of a configuration file in MySQL, that is, "bind-address =.." in the my.ini file. "." Change it to "0.0.0.0", so operate it. Using the "locate" command, no my.ini file was found. Continue to learn that this property is configured in a file called "my.cnf".

# vim / etc/mysql/my.cnf

Figure 3: modifying my.cnf

Save after modification, and then execute the restart command:

Service mysql restart

The remote connection operation continues, and the result is as follows:

Figure 4: remote connection after modifying bind-address configuration properties

2) solve the 1045 problem

As can be seen from figures 2 and 4, although the Host attribute of root users is "%", an error will occur when connecting remotely, with an error code of 1045, and many netizens and bloggers on the Internet can connect successfully in this case, so they wonder why there is still an error. After thinking about it for a long time, I feel that it is possible that I have given root user permissions for a long time and need to be refreshed, so I grant relevant permissions to root users again.

Grant all on *. * to radius@ "%" identified by "root user's login password"; flush privileges;// refreshes permissions to take effect. Mysql > exit; service mysql restart / / restart the MySQL service

After executing the above command, make a remote connection again, and the connection is successful.

Figure 5:root user remote connection result (1)

Figure 6:root user remote connection result (2)

The above is the problem I encountered tonight and the process of solving it, by the way, for reference when I encounter similar problems in the future. If your problem is the same as mine, you can refer to the above methods, and the specific problems have to be analyzed in detail. it is possible that the above methods can not solve your problem, so you have to find another way. Night!!!

Stay up late again, shitless!

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