Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
sir we have server computer in my server room with mysql installed. i have a vb.net application which can connect to database in mysql.

the problem is it works when mysql and vb are on same computers

In same network both on different computers there's a error

"unable to connect to any of the specified MYSQL hosts"


how to resolve this problem and connect to server computer with vb.net application
Posted
Comments
[no name] 27-Mar-14 10:20am    
Use the appropriate connection string.
Asad CR 27-Mar-14 10:25am    
i dont understand..

my application uses the connection string somelike "server=127.0.0.1;user name=****;password=****;database=****"


where to
[no name] 27-Mar-14 10:27am    
What is there to understand? Change your connection string to connect to the IP address of your server machine.
Rage 27-Mar-14 10:29am    
What he meant is that you have to change 127.0.0.1 to your own server. 127.0.0.1 is home. Is the DB on your machine, or on a remote server ?
Asad CR 27-Mar-14 10:31am    
thank u very much but as the modem restarts we have a dynamic DNS.

MYSQL db is on another computer on same LAN... my client computer's ip can change so how can i fix it

1 solution

By default, mysql is only listen to localhost, that could be one of the reason, another reason could be the privilege of the user account for that database is not granted remote access, refer:
http://www.razorsql.com/docs/support_mysql_local.html[^]
 
Share this answer
 
v2
Comments
Asad CR 27-Mar-14 10:38am    
do this have anything to do with firewall.

i have disabled it
Peter Leow 27-Mar-14 11:18am    
I do not think so. Do remember to change the server in the connection string to the ip address of your mysql server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900