Domanda

I use MySQL .NET Connector to communicate with the mysql server. And everything is fine if I set the connection string as:

<add key="ConnectionString" value="Server = localhost; Port = 3306; Database = test; Uid = root; Pwd = root;" />

I'm going to use my program to reach the MySQL Server remotely from another location. How will the connection string supposed to be set in this case? I tried:

... Server = http://localhost; Port = ...

just as experimenting, but didn't work. Thank you.

È stato utile?

Soluzione

Server = localhost specifies the name of the server connected to. In this case it refers to localhost a special name which always refers to the local computer regardless what it is actually called.

You can change this value to the NETBIOS name, DNS name or IP address of the server.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top