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 method that mysql can not connect to the remote server

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

Share

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

This article will explain in detail how mysql can not connect to a remote server. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

How to solve the problem that mysql cannot connect to the remote server: log in to the mysql server first, then use the statement to modify the access permissions of all hosts, the code is [update user set host ='% where user= 'root'], and finally execute the following command directly to solve the error report.

How to solve the problem that mysql can not connect to a remote server:

After logging in to the mysql server, you can use the following query statement to see if remote access is enabled. The query results show that only local root users are allowed to connect.

Select host,user,password from user

You can use the following statement to modify the access permissions of all hosts

Update user set host ='% 'where user =' root'

However, after executing this statement, I found that there was an error, reporting ERROR 1062 (23000): Duplicate entry'%-root' for key 'PRIMARY'.

Later, I looked for it on the Internet and said it was caused by the "only index"! Let's check whether the incoming data is "duplicate", but this is the user table, and I didn't insert the data manually, and of course I can't delete the data from the user table at will, so I found another way to ignore the error directly.

Just execute the following command directly

Flush privileges; about mysql can not connect to the remote server method to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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