Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > MySql access

MySql access
Thread Tools
Philip Heller
Fresh-Faced Recruit
Join Date: May 2012
Status: Offline
Reply With Quote
May 31, 2012, 02:37 PM
 
I'm trying to access a MySql database running on a Mac server cluster, using my MacBook pro as a client. The server cluster lives on my university campus. When I try to access from home, everything is fine. When I try to access from campus I get a "Can't connect to MySQL server" error message.

I can connect to the server machine from campus to do everything else besides MySQL. So I'm pretty sure it's a MySQL permissions problem. And when I try to be a jdbc client from campus, I get an exception that explicitly says "permission denied". So I'm DEFINITELY pretty sure it's a MySQL permissions problem.

Here's my entry in the MySQL user table:

mysql> select host, user, password from user where user='philheller';
+------+------------+-------------------------------------------+
| host | user | password |
+------+------------+-------------------------------------------+
| % | philheller | *09B7D8DBF2350D7F685948FD3C0EF161028C48CC |
+------+------------+-------------------------------------------+


Anybody got any clues?
TIA,
Phil
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
May 31, 2012, 03:07 PM
 
Could be a firewall issue. If your campus is blocking port 3306, this is a good thing. You do not want to be connecting directly to your MySQL shell from home, as unless you configure SSL encryption all of this traffic will be sent in plain-text which is not a good thing. A better bet would be to SSH to the machine, and then access the MySQL shell from there.
     
Philip Heller  (op)
Fresh-Faced Recruit
Join Date: May 2012
Status: Offline
Reply With Quote
May 31, 2012, 04:12 PM
 
But my access problem is when I'm on campus, not at home. If it's the firewall that's blocking me, then would human error account for this? They /intended/ to block outside access, and /actually/ blocked on-campus access. I could convince myself that this is what's happening.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
May 31, 2012, 04:19 PM
 
Originally Posted by Philip Heller View Post
But my access problem is when I'm on campus, not at home. If it's the firewall that's blocking me, then would human error account for this? They /intended/ to block outside access, and /actually/ blocked on-campus access. I could convince myself that this is what's happening.
If they were smart they'd prohibit all outbound port 3306 traffic, which would explain why you can't access MySQL on port 3306 while on campus.

If you want you can try some telnet on port 3306 tests to confirm that this is indeed a firewall issue (if it were a MySQL permissions error you'd still be prompted for your password), but it were me I wouldn't waste my time. Connecting to MySQL on port 3306 is simply a bad idea, no host in their right mind would allow this. It is possible to secure it, but from a network admin perspective there is no way of guaranteeing encryption, so this is a huge liability (especially since this can include sending passwords and/or password hashes in the clear).

Plus, there are several ways around this:

- SSH tunnel to your MySQL server
- SSH hop to your MySQL server
- force using a web-based tool like phpMyAdmin on the MySQL server over SSL
     
Philip Heller  (op)
Fresh-Faced Recruit
Join Date: May 2012
Status: Offline
Reply With Quote
May 31, 2012, 04:26 PM
 
I think you've called it exactly. Thanks, I would have wasted a lot of time fooling around with musql permissions.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
May 31, 2012, 04:31 PM
 
No problem! Please let us know if you'd like help with coming up with an alternate way of accessing MySQL
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Jun 1, 2012, 11:31 AM
 
Originally Posted by Philip Heller View Post
And when I try to be a jdbc client from campus, I get an exception that explicitly says "permission denied".
besson you think a firewall issue is causing permission denied? Or that it's a poorly worded error message?
     
Philip Heller  (op)
Fresh-Faced Recruit
Join Date: May 2012
Status: Offline
Reply With Quote
Jun 1, 2012, 01:39 PM
 
I don't have access to the source code, but I think the jdbc driver can't tell the difference between denial by the firewall and denial by the mysql server. So I think mduell is right, it's a misleading error message.

Out network admin is doing some firewall testing this morning. I'll report back when he tells me something.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jun 1, 2012, 01:44 PM
 
Originally Posted by mduell View Post
besson you think a firewall issue is causing permission denied? Or that it's a poorly worded error message?

I may have misread a part of the original post, you are right that usually firewall problems result in an immediate connection refused sort of error message, but I suppose that it is not out of the realm of possibility for his client (which I'm not familiar with) to give a misleading error message like that.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:03 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,