I have recently installed MySQL on our local server, and I am attempting to connect to it using this connection string:
mySqlConnectionString = "server=192.168.1.254;database=dcim;uid=root;pwd=LlmD62jL;";
I have also tried adding the port as well:
mySqlConnectionString = "server=192.168.1.254:3306;database=dcim;uid=root;pwd=LlmD62jL;";
But I still keep getting the MySqlException:
1042 - Unable to connect to any of the specified MySQL Hosts.
I have tried with the Firewall active and de-activated, but nothing has worked so far. What's going on?
EDIT: I thought I should note that I used this connection string to connect to MySQL on the same machine, with no problems using localhost
or 127.0.0.1
.
NB: This is MySQL Server with .NET Framework connection.
Here's the basic format you could follow:
Server=ServerAddress; Port=1234; Database=DataBase; Uid=Username; Pwd=Password;
Also try to read this article its useful for connection strings. MySQL connection strings
Hope it helps. ",)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.