-   Linux - Software (
-   -   connecting to MYSQL remote database (

opsraja 02-18-2005 04:30 AM

connecting to MYSQL remote database
I have 3 different hosts. One host contains a mysql database and the other 2 hosts (are supposed to anyway) connect to the database remotely. However, only one of them does. The other one does not. It just spits out an error at me. Here is the code I am using to connect. It is identical on both machines which leads me to believe that I have to do something to the host machine, (or maybe something iptables related? i'm not sure). Does anyone know how to fix this? TIA.

// hostname or ip of server

// username and password to log onto db server

// name of database

////////////// Do not edit below/////////

function connecttodb($servername,$dbname,$dbuser,$dbpassword)
global $link;
$link=mysql_connect ("$servername","$dbuser","$dbpassword");
if(!$link){die("Could not connect to MySQL");}
mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error());

Crashed_Again 02-18-2005 06:52 AM

Let me know if this tutorial works. I haven't tried it but it looks like it would do the job.

All times are GMT -5. The time now is 10:20 AM.