English 中文(简体)
如何建立 MySQL 数据库以连接到其它计算机?
原标题:How to set up MySQL database to connect to from another computer?

我对此有巨大的麻烦。

What I want to do is: I want to create a system (in C#) that will (amongst other things) allow users to send simple messages to each other. So I want to create a MySQL database which will rest on a server. Other computers running the system will then have to connect remotely to this database and read a certain table to see if they have any new messages. I want the client computer to connect via the internet to the database on the server.

但我该怎么做?

  1. How do I create a database that can be connected to through the internet?
  2. How should my connection string look like on the client computer?
  3. What configurations do I need to do on both client and server computers?

非常感谢任何援助,如果你能建议我如何实现我的目标。我是一个非常胜任的编程员,但必须制止这些网络!

I am developing in C# using WPF to access the database. So it s a desktop app!

最佳回答

在这里,你怎么做 你要求做什么做。

Use the MySQL Connector/NET ADO.NET connector. It is here. http://dev.mysql.com/downloads/connector/net/5.1.html

遵循设置它的方向,效果很好

将您的 MySQL 服务器放在公共 IP 地址 。

获取客户端软件组件, 通过 ADO. NET 连接器连接到公用 IP 。

但是,请!

问问你自己这样做是否正确。 可能不是, 因为 MySQL 服务器( 和所有表格服务器) 在防火墙后面工作, 接受数量有限的客户包连接时, 工作更加安全且可以预测。

考虑按照 Mike Christensen 的建议行事。 使用 ASP. NET 和 WCF, 或任何您喜欢的堆叠, 建立一个服务器居民界面, 连接您的 MySQL 数据库。 然后服务器居民界面可以被您向终端用户推出的客户软件访问 。

该界面可以拥有您需要的方法 。 WCF 或任何用于构建服务器组件的其他堆叠可以轻松而有力地做到这一点。 例如 。

Client 1: This is moe. Here s a message for curly:  "Look at the grouse, look at the grouse".
Server: OK

Client 2: This is curly: any new messages?
Server: moe says "Look at the grouse, look at the grouse".

Client 1: This is moe. When did curly last collect my messages?
Server: ten minutes ago.

Client 2: This curly. any new messages?
Server: NO

这比仅仅在互联网上提供 MySQL 界面更安全、更可扩缩,

顺便说一下,你似乎想要一个即时信息协议。你也许想研究一下在http://jabber.org 上使用开放源码系统的情况。如果您自己构建它,这可能会很难纠正。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签