Can't connect to MySQL across the LAN

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
So I have a little app I wrote which connects to a MySQL DB on my PC. My boss wants to use it but we keep getting "access denied" kind of messages when he tries to run it from his machine. I'm using a DSN for access. Suggestions? (or requests for more info?)

Edit: both PCs running XP. Also, the "Test" button in the ODBC driver screen works but the app doesn't!
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
You gave him a MySQL account right?
MySQL accounts can also be limited by machine, network etc.

What dooes your user table look like?
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
Yeah, I have a user created for specific use of this app which works perfectly well from my machine (the MySQL host machine). What doesn't make sense is that the ODBC driver thingie seems to "Test" correctly, but then the app won't run!

In the user table, "%" for "Host" (that means "anything", right?) and the username for "User". Obviously the priv's are correct because the app works locally.
 

wkinney

Senior member
Dec 10, 2004
268
0
0
this might be too obvious but does the user have all the correct privledges in the user table, such as Select_priv, Insert_priv etc?
if so then you have to give more detail on the app, is it web based or no, what is the error msg, what kind of statements are you running, etc
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
Yeah priv's etc are all fine b/c the darned application works locally on the machine that runs MySQL. I'll get the exact error here in a bit. It's a VB6 app (don't laugh -- I have no choice).
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
So the error:

Run-time error'-2147467259 (80004005)':

[MySQL][ODBC 3.51 Driver]Access denied for user '<user>'@'%' to database '<dbname>'
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
Originally posted by: wkinney
did you run 'flush privileges' after you added the user?

edited: spelling

Does that matter, given that the app works (with that username) locally?
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: oboeguy
Originally posted by: wkinney
did you run 'flush privileges' after you added the user?

edited: spelling

Does that matter, given that the app works (with that username) locally?

Is there another line in the user table for that username on localhost?
Or is there only one line in the user table for that username?

Forget about the app for a bit and see if you can connect from any remote machine using simply the mysql commandline client.
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
Ah, good idea. I'll give that a try, but I thought that's what the "Test" button is supposed to do?

BTW, that's the only row in the "User" table with that user.

Edit: Stupid question -- where do I get the cmd-line client? I'll look of course, but I don't remember it being a separate download for whatever reason.
 

wkinney

Senior member
Dec 10, 2004
268
0
0
good point oboeguy,

What are the other rows in your user table, there might be a % for host, % for user deny that is superceeding your row.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: oboeguy
Ah, good idea. I'll give that a try, but I thought that's what the "Test" button is supposed to do?

BTW, that's the only row in the "User" table with that user.

Edit: Stupid question -- where do I get the cmd-line client? I'll look of course, but I don't remember it being a separate download for whatever reason.

IIRC, it comes with the install package on windows. But I rarely use windows so I'm not sure. Look for mysql.exe

 

ugh

Platinum Member
Feb 6, 2000
2,563
0
0
The cmd line client should be installed by default under <path to mysql>\mysql\bin. Just get inside the directory and do a:

mysql -u <username> -p <password>
 

skace

Lifer
Jan 23, 2001
14,488
7
81
Wouldn't there be some concern as to whether he can connect to your machine outside of sql across the lan? IE: can he hit \\yourmachine\c$? I seem to recall having issues when someone tried to setup a sql server in a workgroup and was trying to access it from a domain. Sorry if this isn't much help, but I just figured I'd throw it in since it seems like you're still stuck. If so, have him authenticate with your machine first and then try accessing sql.
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
His machine can get to mine, apparently.

But get this -- I wasn't about to install the whole MySQL server on the boss' machine just to get the cmd-line client, but I had in the past installed the "query browser" GUI. I ran it just fine. "WTF?". So the I tried the app... and auto-magically it started working. Somebody explain that one.
 

wkinney

Senior member
Dec 10, 2004
268
0
0
that error from your program looks to be a user authentication error returned from MySql, not a network error
 

wkinney

Senior member
Dec 10, 2004
268
0
0
Originally posted by: oboeguy
His machine can get to mine, apparently.

But get this -- I wasn't about to install the whole MySQL server on the boss' machine just to get the cmd-line client, but I had in the past installed the "query browser" GUI. I ran it just fine. "WTF?". So the I tried the app... and auto-magically it started working. Somebody explain that one.


I'd hate to suggest you entered the password incorrectly the first time :p