connect to remote mysql server using a Php script
My Php script runs on my university campus server.
And I have installed mysql on my local machine.
The following statement doesn't establish a connection
$dbcnx = @mysql_connect("ipaddress", "root", "mypassword");
ipaddress is the address of the machine which has mysql installed.
Do I need to have additional permissions for accessing the mysql database on my machine from the php script.
The book Datasbase Driven Website using Php and MySql ran me smooth until here.
I appreciate any help.
And I guess you have to configure your firewall to allow connections to mysql too (port 3306?)
Just make sure that MySQL server is setup to allow connections from the accessing computer for the username you are attempting to connect with.
Originally Posted by veeracs
If you are trying to connect from a dynamic ip address, you can set it up to allow connections from xxx.xxx.xxx.% if your server supports it.
The book is right...just left room for you to learn a little on your own.
I think the other way around is more common; testing php scripts locally, but using a remote mysql server
Just wondering: impossible to (get permission to) create a mysql db at the university?
Isn't the problem; veeracs is trying to connect to a dynamic ip?
Originally Posted by Deo