mysql access denied

Discussion in 'Free Hosting' started by chegos, Jun 10, 2010.

Thread Status:
Not open for further replies.
  1. chegos

    chegos New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hi, i created one mysql database and add a user with all privileges. when try to connect there are an error:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'chegos_root'@'int.lotus.x10hosting.com' (using password: YES) in /home/chegos/public_html/pruebadb.php on line 7
    Error de conexion Access denied for user 'chegos_root'@'int.lotus.x10hosting.com' (using password: YES)

    the source code:

    1 ?php
    2 $hostname = 'localhost';
    3 $user = 'chegos_root';
    4 $password = '*******';
    5 $nom_base = 'chegos_prestashop';
    6
    7 $conn = mysql_connect($hostname, $user, $password) or die('Error de conexion '.mysql_error());
    8
    9 mysql_select_db($nom_base, $conn) or die('Error sql '.mysql_error());
    10 ?>

    thanks.
     
  2. TechAsh

    TechAsh Retired

    Messages:
    5,853
    Likes Received:
    7
    Trophy Points:
    38
    Hi,

    Please check that the password you are using to connect is correct. Perhaps try changing the password for your MySQL user.
     
  3. danprobo

    danprobo Member

    Messages:
    163
    Likes Received:
    4
    Trophy Points:
    18
    Previously I got similar error, I resolve the error by deleting the user first (NOT THE DATABASE), after that creating user with same name and password, then grant privileges to the new user.
     
    Last edited: Jun 10, 2010
  4. chegos

    chegos New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    The password is correct, however I tried changing the password for a new and still fails.
    I have also tried recreating the user and grant all the permissions and also keeps failing.

    greetings.
     
Thread Status:
Not open for further replies.

Share This Page