質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top