The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

1045 Access denied for user: 'fhca@localhost' (Using passwor

Discussion in 'General Discussion' started by nitromax, Jun 28, 2002.

  1. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    I have a user that is getting the following error message when she runs her PHP script:

    1045 Access denied for user: 'fhca@localhost' (Using password: YES)

    I have searched this forum for answers, and found a solution from back in 2001. I tried it, but it didn't work. Can anyone help me with a fix for this problem? :)
     
  2. snowgod

    snowgod Well-Known Member

    Joined:
    Sep 23, 2001
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    What solution did you try?
     
  3. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    I tried the suggestions mentioned here: http://forums.cpanel.net/read.php?TID=80

    Of course, looking at that again I see that is not the same problem. That thread shows root@localhost, not user@localhost.

    I just haven't worked with MySQL at all and am kind of lost.
     
  4. snowgod

    snowgod Well-Known Member

    Joined:
    Sep 23, 2001
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    From the client's cpanel. Try adding and removing a mysql user. See if that helps.
     
  5. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    I tried adding and deleting a couple of users via the clients control panel. Then I made sure the php script was using the user that I created, but I still get the same error message.

    Any other suggestions?
     
  6. andyf

    andyf Well-Known Member

    Joined:
    Jan 7, 2002
    Messages:
    246
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    1045 Access denied for user: 'fhca@localhost' (Using password: YES)

    surely that should be username_fhca@localhost when you configure the php script.

    remember all db's and user's are prefixed with username_

    Andy
     
  7. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    Hi Andy,

    Yes, I noticed that too. I tried adding the users from the control panel and made one as fhca_test, and fhca_rita (owner of the website's name) and then applied them to the database being called in the script. But each time I got the same error.
     
  8. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Are you absolutely completely sure that she's adding the user to the database? (not just creating the user, but adding it to the database too)
     
  9. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    Hi Juanra,

    Yes! I did that myself several times with 2 different usernames. And I made sure not only to create the user, but added it to the database. I still get the same error.
     
  10. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    apologies if you'd tried this, but if you just recently upgraded your php build (from something pre 4.1.2) it might be that the new php config needs some more details in /etc/hosts, to find localhost....

    Perhaps only for particular applications..... ?
    It seems its picky

    Anyway make sure /etc/hosts is updated as cpanel requires it
    (/scripts/fixetchosts)


    just making sure you'd seen that one.
     
  11. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    Hi Fenor,

    Thanks for the suggestion. I hadn't tried that, but I did just now and I still have the same problem.

    When I upgraded to PHP 4.2.1 I noticed that it was compiled with some different options. I don't have a copy of what they were before the upgrade. Would there be any specific option that should have been included at the time of compilation?

    Would it help to reload certain perl modules? If yes, which ones?

    I used the /scripts/easyapache to upgrade, and I just used the Beginner option when prompted. Any other ideas? I also installed the Zend Optimized 1.3.0, and the newest version of Curl.

    ??? :p


    BTW... Here is the script my client is using, and has been using for some time now. It broke after we upgraded PHP:


    &head&
    &title&Florida Assisted Living Affiliation Data Load&/title&
    &/head&
    &body&
    &p& &h3&Load Test Data for FALA Member Search&/h3&&p&
    &?php
    $hostname=&localhost&;
    $username=&fhca_rita&;
    $password=&******&;
    $db = mysql_pconnect($hostname, $username, $password);
    if ($db == false) {
    $error = mysql_errno();
    $errmsg = mysql_error();
    printf(&Hello, did not connect!!!!&br&$error $errmsg&);
    } else {
    $result = mysql_select_db(&fhca_org&,$db);
    if ($result == false) {
    $error = mysql_errno();
    $errmsg = mysql_error();
    printf(&Hello, did not select!!!!&br&$error $errmsg&);
    } else {
    $result = mysql_query(&load data local infile \&fala.txt\& replace into table fala fields terminated by \&;\&&,$db);
    if ($result == false) {
    $error = mysql_errno();
    $errmsg = mysql_error();
    printf(&Hello, did not load!!!!&br&$error $errmsg&);
    }

    }
    }
    $result = mysql_query(&select facid from fala&,$db);
    if ($result == false) {
    $error = mysql_errno();
    $errmsg = mysql_error();
    printf(&&br&Hello, did not count!!!!&br&$error $errmsg&);
    printf(&&);
    } else {
    $rows = mysql_num_rows($result);
    printf(&&br& $rows&);
    }
    ?&
    &/body&
    &/html&
     
  12. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    Dude, in all honesty this could go a variety of ways.

    If you thing perl modules are at fault, definitely re-run
    /scripts/cleanmd5
    /scripts/fixinterchange
    /scripts/installdbi

    That forces the installs (or at least verifies) the perl module integrity for about 99.9% of the BIG DAWG modules that actually take care of most perl-related apps.

    If you've got people that were using the mysql auth module for apache, perhaps that evaporated with your latest build.

    Try reinstantiating that module in a rebuild?


    Looking at the code at 12:42 AM makes me sleepy............................................................


    ZZzzzzzzzzzzzzzzz ?
     
  13. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    How can You tell what MySQL was configured with???

    Hi Fenor,

    How can you tell what MySQL was configured with???

    That script I showed on page one of this post uses the &load data infile& command. According to this page (http://www.mysql.com/doc/L/O/LOAD_DATA_LOCAL.html) it looks like MySQL version 3.23.49 is automatically configured with the --enable-local-infile option.

    But we have version 3.23.45 installed, and I don't know if that option if configured by default or not, or if the 1148 error message would be displayed for our installed version.

    Does CPanel have a way of upgrading to the latest version of MySQL 3.23.51?

    Thanks in advance...
     
  14. bennet

    bennet Well-Known Member

    Joined:
    Apr 25, 2002
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Same Problem

    &$result = mysql_query(&load data local infile \&fala.txt\& ...&

    Same Problem
    I am with the same problem. See:

    Grants goes wakigawa@localhost
    GRANT USAGE ON *. * TO ' wakigawa' @ ' localhost' IDENTIFIED BY PASSWORD ' 4cf7fd99245dac2c '
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON wakigawa_school. * TO ' wakigawa' @ ' localhost'

    The permission for this operation, it should include the grants FILE, it is not specified.
    I don't also know as doing that, because I am reselling.
     
  15. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    What does apache error log say when you run the script?
     
Loading...

Share This Page