i have a mysql server on a different computer from my webserver, and i would like to use php to do database queries, etc. so to test the connection, i made a php file with the code
i have MySQL on 10.0.0.12 and apache on 10.0.0.11
<?php
$db = mysql_connect("10.0.0.12", "root");
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT * FROM employees",$db);
printf("First Name: %s<br>\n", mysql_result($result,0,"first"));
printf("Last Name: %s<br>\n", mysql_result($result,0,"last"));
printf("Address: %s<br>\n", mysql_result($result,0,"address"));
printf("Position: %s<br>\n", mysql_result($result,0,"position"));
?>
yes, the database works, and I can use the MySQL program on 10.0.0.12 to execute this query. but when viewed in a browser, the page shows this error:
Warning: Host '10.0.0.11' is not allowed to connect to this MySQL server in /usr/local/apache/htdocs/random/phptest/sqltest.php on line 5
how do i enable 10.0.0.11 to remotely access the MySQL server?