StealthRT
StealthRT

Reputation: 10542

Connect to mySQL over LAN

Hey all, i am having problems with connecting to a PC on my local LAN thats running the mySQL database.

The code in VB6 i have is:

.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=\\SERVERPC;DATABASE=lstoredb;UID=root2;PWD=thepassw;OPTION=3"

If i put "localhost" then it works just fine (i have mysql running on my DEV system as well) But once i put it on the other machine it doesn't ever connect.

I can access the SERVERPC in my network but for some reason VB6 can not find it? I've even tried the IP address:

.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=192.168.1.9;DATABASE=lstoredb;UID=root2;PWD=thepassw;OPTION=3"

And it still does not work. Turned off all firewalls and still nothing... Even added port 3306 to my router for the 192.168.1.9 IP and nothing still!

The DEV computer is Windows XP SP3 and the mySQL server is on Vista Home Prem. 32-bit.

Any help would be great! Thanks! :o)

David

Upvotes: 0

Views: 2728

Answers (1)

jordanbtucker
jordanbtucker

Reputation: 6078

You need to tell MySQL to allow remote connections to certain databases from certain hosts for certain users. Source

Upvotes: 1

Related Questions