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

Recommended Answers

All 3 Replies

Notice:

I had successfully pinged both servers

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

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

Problem Solved!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.