Jump to content

Problem connecting to a remote database


jose.natali

Recommended Posts

Can somebody help?

 

Here is the info:

 

Two computer, Fedore core 6 OS, php 5, apache 2, MySQL 5

Every computer 2 NICs, first     NIC 10/100         (192.168 network),

                               second NIC 10/100/1000 (10.0 network)

 

Computers are behind of PfSense firewall only in the 192.168 network. (extra info, just in case)

 

computer one = node01 (Web Server),

computer two = node02 (MySQL Server)

 

node02 - acount create in MySQL Server for node01

node01 - can access MySQL Server using terminal->mysql client, no problems!  ;D

 

When I try to do connection to node02 using PHP I get the message in the logs, that the connection can not be establish to 10.0.0.x.  >:(

 

I especified in the code the ip address for the host, the user, and the password for MySQL server.

 

What can be the problem? if somebody have an idea, please help me.

Link to comment
https://forums.phpfreaks.com/topic/43776-problem-connecting-to-a-remote-database/
Share on other sites

Thanks for a fast response.  Yes, I'm sure. As I said, I'm able to connect

from node01 to node02 using mysql client.

i.e.: mysql -h 10.0.0.1 -u username -p

or mysql --host=10.0.0.1 --user=username --password=password

 

connection is established and I have full access in this way, but not using my

webserver with php.  any ideas??? May be relate somehow, that I'm using

a NIC#1 for access the webserver and NIC#2 for PHP to access the database?  ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.