Problem conecting to MySQL

Discussion in 'PHP' started by knightrider, Sep 13, 2007.

  1. #1
    Hi. I trying to conect to MySQL with this line:

    , <?php
    //function Conec()
    // {
    if (!($link=mysql_connect("localhost","root","utopia")))
    {
    echo "Error conectando a la base de datos.";
    exit();
    }
    if (!mysql_select_db("construccion",$link))
    {
    echo "Error seleccionando la base de datos.";
    exit();
    }
    return $link;
    // }
    //$link=Conectarse();
    //echo "Conexion con la base de datos conseguida.<br>";
    //mysql_close($link); //cierra la conexion
    ?>

    ___________________________
    and I get this response :
    ,
    Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in D:\Inetpub\wwwroot\conexion.php on line 4
    Error conectando a la base de datos.

    I´m working with:
    * Win XP
    * IIS
    * PHP 4.3
    * AND MySQL Server 4.1
     
    knightrider, Sep 13, 2007 IP
  2. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    #2
     $link=Conectarse();  
    PHP:
    You are calling a function thats non-existent!
    try changing it to
     $link = Conec(); 
    PHP:
     
    killerj, Sep 13, 2007 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  4. knightrider

    knightrider Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Problem solved!:D
    http://dev.mysql.com/doc/refman/5.0/en/old-client.html
     
    knightrider, Sep 13, 2007 IP