Newbie. help with database error 1045

Discussion in 'MySQL' started by jatss123, May 12, 2008.

  1. #1
    Hi Guys,
    I have made small guest book script on my website.
    I have error 1045, Fatal error: Access denied for user 'xxxxxx'@'localhost' (using password: YES) :mad: :mad:

    <?php

    $hostname_conn_greenideaz = "localhost";
    $database_conn_greenideaz = "xxxxxxxxx";
    $username_conn_greenideaz = "xxxxxxxxx";
    $password_conn_greenideaz = "xxxxxxx";
    $conn_greenideaz = mysql_pconnect($hostname_conn_greenideaz, $username_conn_greenideaz, $password_conn_greenideaz) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>


    I have same guest book in my desktop and i am not writing password in guest book so it works fine. But when I am uploading php page on web server it asking for password in server database. :eek::eek:
    Can any one help me with this error.
     
    jatss123, May 12, 2008 IP
  2. hillord

    hillord Well-Known Member

    Messages:
    2,211
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    140
    #2
    have u create a mysql database account?
     
    hillord, May 12, 2008 IP
  3. jatss123

    jatss123 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have written connection code for your knowledge. On php page I am connecting with database but there is error 1045.

    If I am trying same code on username "root" on my desktop then it works fine. But on web server it creates problem about username and password...

    I am confused.. :eek::eek:

    Please help guys. This is my web page and problem is on guest page.

    greenideaz.com
     
    jatss123, May 12, 2008 IP
  4. JenniP

    JenniP Peon

    Messages:
    250
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well have you checked a few things (Sorry if these sound basic but sometimes its best to be sure).

    Do you have MySQL on the remote server?
    Is it running on LOCALHOST?
    Has your hosting provider given you a username and password?
    If so do they match whats in your script? Since you mention root in your post above that could be the problem since your not likely to have the root password on shared hosting.

    It may be worth pinging an email to your hosting provider just to check these details.

    Jen
     
    JenniP, May 12, 2008 IP
  5. jatss123

    jatss123 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thnx very much Jen,

    I've checked few things with my current web hosting provider. They told me your file for connection does not match.
    I've tried few times and now I have solved problem.

    THnx again. :):)
     
    jatss123, May 13, 2008 IP