Вопрос

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