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 > Developer Center > PHP and MySQL on separate computer on my LAN

PHP and MySQL on separate computer on my LAN
Thread Tools
insha
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Feb 13, 2006, 10:37 PM
 
Okay... sorry about that. I thought the post was accpeted properly.

I need to connect to MMySQL server that is running on my Mac mini (running 10.4.4) from my iMac (Intel Duo, also running 10.4.4). Both of these Macs are on my LAN and I can get on to the webserver running on my Mac mini.

When I try to get to run a simple script in PHP on my iMac that connects to the MySQL database on the Mac mini I get the 'Can't connect to the '###.###.#.#' (4)' error. I am I missing something here? Do I have to change a setting in Apache on my Mac mini to allow connection from different clients?

Thanks in advance,

Cheers!
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 13, 2006, 11:18 PM
 
Do you have a firewall on the Mac mini?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Tomchu
Mac Elite
Join Date: Sep 2005
Status: Offline
Reply With Quote
Feb 13, 2006, 11:27 PM
 
Make sure that MySQL is also listening on a TCP port, and not working over just sockets.
     
madmacgames
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Feb 14, 2006, 12:36 AM
 
Also make sure your MySQL user is setup to allow to connect from that IP. Usually the default setup is connection allowed on localhost/127.0.0.1

To allow connections across the LAN, you will probably have to setup the user on 192.168.1.* as well.
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
     
insha  (op)
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Feb 14, 2006, 01:00 AM
 
Originally Posted by Chuckit
Do you have a firewall on the Mac mini?
Yes. I do have the firewall turned "on" on the Mac mini. I didn't think of this earlier, but let me check if it is blocking port 3306.

Thanks.
     
insha  (op)
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Feb 14, 2006, 01:02 AM
 
Originally Posted by madmacgames
Also make sure your MySQL user is setup to allow to connect from that IP. Usually the default setup is connection allowed on localhost/127.0.0.1

To allow connections across the LAN, you will probably have to setup the user on 192.168.1.* as well.
That was my first guess, and I have made sure that the user id I'm using is allowed to connect from the IP; but more than likely it is the firewall, as Chuck pointed out.

Thank you.
     
deuce868
Fresh-Faced Recruit
Join Date: Oct 2005
Status: Offline
Reply With Quote
Feb 14, 2006, 07:44 PM
 
There is a line in the my.cnf that tells mysql to listen for connections from outside of localhost. Double check that.

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address =xxx.xxx.xxx.xxx
     
insha  (op)
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Feb 15, 2006, 12:04 PM
 
I enabled port 3306 in my Firewall settings on my Mac mini (where MySQL is running) and I was able to connect to it from my iMac. Not sure if this is the best way; but it is working and I believe that is what Chuck alluded to in his post earlier.

Thanks all.

Cheers
     
   
Thread Tools
 
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 06:17 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.,