Note that there are some explanatory texts on larger screens.

plurals
  1. POConnect to mysql on a different server
    text
    copied!<p>Im trying to connect to mysql database server from another server. The following are configurations on both servers.</p> <blockquote> <p>Server 1: I installed xampp with php and apache services and it has the following ip 172.x1.x1.x1</p> <p>Server 2: I installed mysql and it has the following ip 172.x1.x1.x2.</p> </blockquote> <p>the following is the connection script I am using to connect to the database</p> <pre><code>&lt;?php //Database connection constants define("DATABASE_HOST", "172.x1.x1.x2"); define("DATABASE_USERNAME", "root"); define("DATABASE_PASSWORD", ""); define("DATABASE_NAME", "management"); ?&gt; </code></pre> <p>The above script is in a file called app_config.php and its located in server 1 The following script is in a file called connect.php and its also located in server 1</p> <pre><code>&lt;?php require 'app_config.php'; $connect_error = 'Sorry we\'experiencing connection problems.'; $table_error = 'Table not found'; mysql_connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD) or die($connect_error); </code></pre> <p>mysql_select_db(DATABASE_NAME) or die($table_error); ?> now when I try to connect I get the following error</p> <blockquote> <p>Warning: mysql_connect() [function.mysql-connect]: Host 'hr1.saqa.co.za' is not allowed to connect to this MySQL server in C:\xampp\htdocs\scripts\functions\database\connect.php on line 4</p> <p>Fatal error: Call to undefined function handle_error() in C:\xampp\htdocs\scripts\functions\database\connect.php on line 5</p> </blockquote> <p>It will be awsome if you can help me guys.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload