|
|
PHP and MySQL on separate computer on my LAN
|
|
|
|
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status:
Offline
|
|
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!
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Do you have a firewall on the Mac mini?
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2005
Status:
Offline
|
|
Make sure that MySQL is also listening on a TCP port, and not working over just sockets.
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Oct 2003
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Oct 2005
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|