Alexis Zenigata Alexis Zenigata - 4 months ago 15
PHP Question

Connecting to a remote database from a localhost computer using mysql and PHP

So here is the situation.
I have a database on a remote server that gives out quizzes and scores for individual students...

I also have a local database which contains the students names and their respective groups.

What I want to do is to display the list of students per group then show the results of their scores from the remote database.. Is this possible??

Im currently running the script from my local computer using XAMMP like so
mysql_connect("REMOTE SERVER ADDRESS","USERNAME", "PASSWORD") or die("Could not connect to MySQL server!");

But all I get is Could not connect to MySql Server..

Answer
GRANT ALL ON database.* TO user@ipaddress IDENTIFIED BY 'password';

You should force a reload of the grant tables using:

FLUSH PRIVILEGES;
Comments