如何将数据添加到远程mysql数据库?

编程入门 行业动态 更新时间:2024-10-23 11:21:19
本文介绍了如何将数据添加到远程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和您从中调用数据的服务器名称。 您可以从 www.connectionstrings获取connectionStrings / mysql / [ ^ ]。大多数情况下,服务器部分是您需要最关注的部分。因为您在字符串的该部分连接到服务器。因此,指定IP地址,服务器名称将去那里。 此外,确保允许每个用户或所需用户的远程连接, stackoverflow/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 www.connectionstrings/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, stackoverflow/questions/8380797/enable-remote-mysql-connection[^]. Give this a read.

更多推荐

如何将数据添加到远程mysql数据库?

本文发布于:2023-10-27 03:02:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1532117.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   数据库   数据   mysql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!