简体   繁体   English

通过Internet连接MySQL和.net应用程序有危险吗?

[英]Is connecting MySQL and .net application via Internet a hazard?

For a small project I need to store some data in MySQL. 对于一个小项目,我需要在MySQL中存储一些数据。 The users are located world wide and run a .net ClickOnce application. 用户位于全球范围内并运行.net ClickOnce应用程序。 The data accessed are not really confidential and even if someone would get access this would not harm from the privacy perspective. 访问的数据并非真正保密,即使有人可以访问,这也不会从隐私角度受到伤害。

Technically it is possible to have the MySQL database located on a server somewhere and have everybody connected via Connector/Net over the internet. 从技术上讲,可以将MySQL数据库放在某个服务器上,并通过Internet 连接所有人通过Connector / Net 连接。 But is this advisable? 但这是否可取?

  1. Is the protocol stable / robust enough to handle even slow internet connections? 协议是否足够稳定/健壮以处理缓慢的互联网连接?
  2. Would this be a severe security risk. 这会是一个严重的安全风险。 Encryption of the data is not a topic, but password encryption is. 加密数据不是主题,而是密码加密。 Would opening a MySql database (port) to the Internet be a hazard? 打开MySql数据库(端口)到Internet会有危险吗?

Alternatively I could "wrap" the DB access via web services, or somehow else. 或者,我可以通过Web服务“包装”数据库访问,或者其他方式。 But of course this is some overhead I'd like to avoid. 但当然这是我想避免的一些开销。 So is connecting MySQL via Internet a valid option? 那么通过Internet连接MySQL是一个有效的选择吗?

Remarks: 备注:

I'd recommend implementing a REST web services layer for your remote .NET applications to talk to. 我建议为您的远程.NET应用程序实现REST Web服务层。 Then you could have the server that handles the web service requests have local access to the database and you wouldn't worry about whether the MySQL protocol was up to the job. 然后,您可以让处理Web服务请求的服务器具有对数据库的本地访问权限,您不必担心MySQL协议是否适合工作。

My experience is that the MySQL protocol might work over a WAN, but it's really intended to be used on a local network, so the latency of the WAN would make the transaction intolerably slow. 我的经验是MySQL协议可能在WAN上运行,但它确实打算在本地网络上使用,因此WAN的延迟会使事务变得无法忍受。

Also the MySQL Server would have to expose its port (3306 by default) and that's not really hardened so unless you connect via VPN or stunnel or something it wouldn't be secure. 此外,MySQL服务器必须公开其端口(默认为3306)并且这并没有真正强化,所以除非你通过VPN或stunnel连接或者它不安全。

The MySQL client/server protocol does not transmit passwords in plain text, it hashes the password on the client before sending. MySQL客户端/服务器协议不以明文形式传输密码,在发送之前在客户端上散列密码。 But I understand MySQL Connector/NET doesn't use the MySQL client, so I don't know for certain if it does the same thing with password hashing on the client end. 但我知道MySQL Connector / NET不使用MySQL客户端,所以我不确定它是否在客户端使用密码哈希做同样的事情。

1) This protocol is stable, was using it for long time. 1)该协议稳定,长期使用。

2) You shouldn't share your DB outside youre local network, it's a high security risk. 2)您不应该在本地网络之外共享您的数据库,这是一个很高的安全风险。 You should make some layer on your DB server throgh which you will access data from the DB. 您应该在数据库服务器上创建一些层,您将从数据库访问数据。 Also you can make WCF server between client-side and db . 您还可以在client-sidedb之间创建WCF服务器。

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

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