5
Answers

connecting to MySQL via Network

Ask a question

hi guys..i am trying to connect to a database in the other computer which is in network...i should do it by using MySql..to do that i installed MySqlConnector for .Net in my pc and referenced it to my program and coded like below in try catch block
MySqlConnection
connect = new MySqlConnection("server=pcname/Localhost;database=dbname;uid=a;pwd=b");
connect.Open();
Console.WriteLine("Baglanti Durumu : {0}",connect.State);
connect.Close();
and i am getting such an error "Unable to connect to any of the specified MySQL hosts "
so what can i do to get rid off that error...i am not sure about my connection string because i am working with MySql for the first time..and i am not sure if the settings are done correctly
can u help pls ? where is my mistake ?

Answers (5)