remote database connection problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sbettadpur
    New Member
    • Aug 2007
    • 121

    #1

    remote database connection problem

    hi,

    i wrote a script in php, to connect remote database server. i am getting the following errors

    Warning: mysql_connect() [function.mysql-connect]: Host 'IPaddress(i changed)' is not allowed to connect to this MySQL server in c:\wamp\www\Exp t\dbconnection. php on line 8

    and my scripts goes like this

    <?php
    #$host = "localhost" ;
    $host = "192.168.0.100" ;
    $user = "root";
    $passwd = "";
    $db = "productionphoe nixhrdb";

    $cxn = mysql_connect($ host,$user,$pas swd);
    $db = mysql_select_db ($db,$cxn);

    $query = "select * from agreement";
    $result = mysql_query($qu ery);
    $row = mysql_num_rows( $result,$cxn);
    echo $row;
    if($cxn)
    echo "connect";
    ?>

    please get me the feedback
  • George Lft
    New Member
    • Dec 2007
    • 25

    #2
    Originally posted by sbettadpur
    hi,

    i wrote a script in php, to connect remote database server. i am getting the following errors

    Warning: mysql_connect() [function.mysql-connect]: Host 'IPaddress(i changed)' is not allowed to connect to this MySQL server in c:\wamp\www\Exp t\dbconnection. php on line 8

    and my scripts goes like this

    <?php
    #$host = "localhost" ;
    $host = "192.168.0.100" ;
    $user = "root";
    $passwd = "";
    $db = "productionphoe nixhrdb";

    $cxn = mysql_connect($ host,$user,$pas swd);
    $db = mysql_select_db ($db,$cxn);

    $query = "select * from agreement";
    $result = mysql_query($qu ery);
    $row = mysql_num_rows( $result,$cxn);
    echo $row;
    if($cxn)
    echo "connect";
    ?>

    please get me the feedback
    where did you copy that script ? your host shoud be something other than localhost.

    Comment

    Working...