[英]Connect a remote Mysql database with Visual Studio
I have an application in Visual Studio that connects with a database in mysql, I'm using wamp server. 我在Visual Studio中有一个与mysql中的数据库连接的应用程序,我在使用wamp服务器。 In the first place works fine connected locally, but my question is what do I have to write/do if I want to connect this application with a remote mysql database in other place that is not local?
首先,在本地连接良好,但我的问题是,如果我想将此应用程序与不在本地的其他地方的远程mysql数据库连接,该怎么做?
Here is the code that I have to work locally: 这是我必须在本地工作的代码:
public static MySqlConnection ObtenerConexion()
{
MySqlConnection conectar = new MySqlConnection("server=127.0.0.1; database=tarjetas; Uid=root; pwd=;");
conectar.Open();
return conectar;
}
I tried to put the IP from the other Pc and doesn't work. 我试图将其他PC上的IP放入,但不起作用。 The other PC has the same VS application and work as fine as mine locally.
另一台PC具有相同的VS应用程序,并且在本地可以正常工作。
None of those databases has an user or password. 这些数据库都没有用户名或密码。 I tried to modify some wamp files that some users advice in other posts, but nothing of that worked.
我试图修改一些用户在其他帖子中建议的wamp文件,但是这些都不起作用。
Another thing that I have to say it's that I'm proficient with the network configurations. 我不得不说的另一件事是,我精通网络配置。 So the only thing that I have, is the IP from the other Pc that has the database.
因此,我唯一拥有的就是来自具有该数据库的其他PC的IP。
What else do I have to do to make that connection remotely? 要远程建立连接,我还需要做什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.