简体   繁体   English

无法通过IP地址连接到MySQL

[英]Unable to connect to MySQL via IP Address


I tried to use google, but it seems that there is no solution, at least not to my case. 我尝试使用google,但似乎没有解决方案,至少在我看来并非如此。

i'm a C# programmer, and recenly I decided to try out to build some application which use data. 我是C#程序员,最近我决定尝试构建一些使用数据的应用程序。
For that, I started to using MySQL. 为此,我开始使用MySQL。

Currently, I have installed: 目前,我已安装:

  - MySQL Community Server 5.5.20
  - MySQL Workbench 5.2.37

In the workbench I have Server Instance that has hostname = localhost . 在工作台中,我有具有主机名= localhost的 服务器实例
I have a connection too, which poining to the hostname = localhost . 我也有一个连接 ,它连接到主机名= localhost
It works perfect. 完美的作品。
I finished the development of my application, and it works perfect with the database. 我完成了应用程序的开发,并且它与数据库完美配合。

As for the problem: 至于问题:

Now, I want my application to work from other machines. 现在,我希望我的应用程序可以在其他计算机上运行。
For that, I changed the following: 为此,我更改了以下内容:

  1) From the workbench: I removed the Server Instance containing localhost.
  2) I created new Server Instance, but now I chose "Remote Host" and I
     put my IP Adress: 79.179.XX.XXX (X - to hide my ip there)
     and then I pressed next.

Now, while it trying to test the connection it says: 现在,当它尝试测试连接时,它说:
Can't connect to MySQL server on '79.179.XX.XXX' (10061) 无法连接到'79 .179.XX.XXX'上的MySQL服务器(10061)

My application also can't open the connection when I change the hostname 更改主机名时,我的应用程序也无法打开连接
in the connection string to my ip. 在连接字符串到我的IP。
Note: I has router, and I forwarded 3306 port and the port is opened. 注意:我有路由器,并且转发了3306端口,并且该端口已打开。 If you need any information I will edit and write. 如果您需要任何信息,我将进行编辑和编写。

What can be the problem there? 那里可能是什么问题?
How can I fix it? 我该如何解决? Thank you. 谢谢。

检查my.cnf文件,以确保未启用跳过网络。

Assuming that your user name is blammy , did you setup a blammy@79.179.xxx.xxx in mysql? 假设您的用户名是blammy ,您blammy@79.179.xxx.xxx在mysql中设置了blammy@79.179.xxx.xxx If no, then you need to do so. 如果否,那么您需要这样做。

Try using the mysql client to connect to 79.179.xxx.xxx, if the account is the cause, then login should fail here as well. 尝试使用mysql客户端连接到79.179.xxx.xxx,如果是帐户原因,则登录也将在此处失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM