954,242 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VM (CentOS) network configuration

I am developing a web page which retrieve data from a seperate mysql server
on the same network
musql_connect('192.16.1.2:3306', 'root', '123');

but ana error shows

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '192.16.1.2' (13) in /var/www/html/index.php on line 3

the 2 servers are on 2 different virtual network (I am using centos on virtual box)

I have set the webserver(apache) on 192.16.1.1
and the mysql on 192.16.1.2

when I tried locally it had worked!

please help

f.damati
Light Poster
28 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

Notice:

I had successfully pinged both servers

f.damati
Light Poster
28 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

Hello,

Your problem is that the server you are trying to connect to is not set to accept outside connections from the other server in mysql. Check out the following link at the mysql site more information on howto connect.

http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html

rch1231
Posting Shark
959 posts since Sep 2009
Reputation Points: 119
Solved Threads: 142
 

THANK YOU,
IT was really a great Help. :) :)

Problem Solved!

f.damati
Light Poster
28 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: