如何将数据添加到远程mysql数据库? [英] how to add data to remote mysql database?

查看:143
本文介绍了如何将数据添加到远程mysql数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我写了应用程序C#将数据添加到mysql数据库,它的成功。

现在我想将数据添加到远程mysql数据库。

例如,我在笔记本电脑上运行的C#app有IP 192.168.1.2,我想用这个应用程序将数据添加到其他笔记本电脑的IP地址为192.168.1.10。

请帮帮我。谢谢。

Hi I write app C# to add data to mysql database, its success.
Now I want to add data to remote mysql database.
For example, my C# app run in laptop have IP 192.168.1.2 and I want to use this app to add data to mysql in other laptop with IP 192.168.1.10.
Please help me. Thanks.

推荐答案

如果您编码正确,您只需更改配置文件中的连接字符串。
If you coded this right, all you have to do is change your connectionstring in the config file.


执行命令的麻烦主要是由SQL连接的ConnectionString引起的。如前所述,您需要测试ConnectionString和您从中调用数据的服务器名称。



您可以从 http://www.connectionstrings.com获取connectionStrings / mysql / [ ^ ]。大多数情况下,服务器部分是您需要最关注的部分。因为您在字符串的该部分连接到服务器。因此,指定IP地址,服务器名称将去那里。



此外,确保允许每个用户或所需用户的远程连接, http://stackoverflow.com/questions/8380797/enable-remote-mysql-connection [ ^ ]。给这个读一读。
The trouble in executing the command is mostly caused by the ConnectionString for the SQL connection. As already mentioned, you need to test the ConnectionString and the server name that you're calling the data from.

You can get the connectionStrings from http://www.connectionstrings.com/mysql/[^]. Mostly, the Server part is the part that you need to focus on the most. Because you connect to the server in that part of the string. So, specifying the IP address, Server name would go there.

Also, make sure that the remote connection for every user or the required users is allowed, http://stackoverflow.com/questions/8380797/enable-remote-mysql-connection[^]. Give this a read.


这篇关于如何将数据添加到远程mysql数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆