Connect to remote MySQL database

Nirosha

New member
Joined
Dec 10, 2012
Messages
1
Programming Experience
1-3
My connection string as follows.

conn.ConnectionString = "Server=192.248.***.***; Port=3306; User id=admin; password=***; Database=abc; Connect Timeout=60;"But it returns error:
"PassbookPrinter.vshost.exe Error:0:Unable to connect to any of the specified MySQL hosts.
A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurre."

But i can log in to the same using PHPMyAdmin.

//192.248.***.***/phpmyadmin

Also i can log in to local MySQL database using:


conn.ConnectionString = "server=" & "localhost" & ";" & "user id=" & "admin" & ";" & "password=" & "" & ";" & "database=abc"

What is the wrong in this code. I want to connect to the remote database since it is the requirement of the system. Any help please.
 
Back
Top