mysql_connect()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pankaj

    mysql_connect()

    am trying to connect to a database. When I use the following syntax,
    the connections works

    $server=localho st
    $username=myuse rname;
    $password=mypas sword

    mysql_connect($ server,$usernam e,$password);

    However, if I change the $server="server _ip", I get an error
    "Access Denied for user user_name@" (using password:YES)

    What could be wrong ? Is it some permission issue ?

  • Laurent Duretz

    #2
    Re: mysql_connect()

    Pankaj a écrit :
    am trying to connect to a database. When I use the following syntax,
    the connections works
    >
    $server=localho st
    $username=myuse rname;
    $password=mypas sword
    >
    mysql_connect($ server,$usernam e,$password);
    >
    However, if I change the $server="server _ip", I get an error
    "Access Denied for user user_name@" (using password:YES)
    >
    What could be wrong ? Is it some permission issue ?
    >
    If you are using tour ISP IP, it could be wrong.
    Try 127.0.0.1

    Comment

    • JDS

      #3
      Re: mysql_connect()

      On Thu, 20 Jul 2006 05:28:46 -0700, Pankaj wrote:
      am trying to connect to a database. When I use the following syntax,
      the connections works
      Please don't MULTIPOST!
      --
      JDS

      Comment

      • Dima Vidmich

        #4
        Re: mysql_connect()


        Pankaj wrote:
        am trying to connect to a database. When I use the following syntax,
        the connections works
        >
        $server=localho st
        $username=myuse rname;
        $password=mypas sword
        >
        mysql_connect($ server,$usernam e,$password);
        >
        However, if I change the $server="server _ip", I get an error
        "Access Denied for user user_name@" (using password:YES)
        >
        What could be wrong ? Is it some permission issue ?
        Probably your mysql login was created with restrict on connection
        address.
        Try grant also username@server _ip as was granted username@localh ost
        or update your login entry in mysql.user with Host='%' to allow any
        connection ip

        WBR, Dima Vidmich

        Comment

        Working...