Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

[Solved] Bonk Error Message : Access denied for user 'mysql_username@localhost'*

pwolfepwolfe New
edited February 2014 in Vanilla 2.0 - 2.8

I can no longer access my forum and keep receiving a Bonk error message. I have pasted the error message report below. Line 61 in bold is where it is highlighted in RED. Could someone please let me know how I can fix this?

SQLSTATE[28000] [1045] Access denied for user 'young_vani834'@'localhost' (using password: YES)

The error occurred on or near: ------/library/database/class.database.php

57:             $this->_Connection = new PDO(strtolower($this->Engine) . ':' . $this->Dsn, $this->User, $this->Password, $this->ConnectionOptions);
58:             if($this->ConnectionOptions[1002])
59:                $this->Query($this->ConnectionOptions[1002]);
60:          } catch (Exception $ex) {
**61:             trigger_error(ErrorMessage('An error occurred while attempting to connect to the database', $this->ClassName, 'Connection', $ex->getMessage()), E_USER_ERROR);**
62:          }
63:       }
64:       
65:       return $this->_Connection;
Tagged:

Comments

  • Options
    pwolfepwolfe New
    edited February 2014

    And at the top of the message it says:

    **Fatal Error in Gdn_Database.Connection();

    An error occurred while attempting to connect to the database**

  • Options
    ShadowdareShadowdare r_j MVP
    edited February 2014

    Please check if the MySQL username and password login, host, and database name settings are correct in the /conf/config.php file. If they are indeed correct, then perhaps the MySQL login info was changed on the server side or read and write permissions for the database user may need to be granted to the database.

    Add Pages to Vanilla with the Basic Pages app

  • Options

    The username and password were never changed. The error started appearing when I tried editing the config.php file to redirect users to a different email confirmation url within my embedded Wordpress theme. When I made the changes I saw the error, then I went back to the config.php file and reverted it back to the old version, but the error still wouldn't go away. Not sure why it keeps appearing since I never had any problems with it before.

    I'd hate to have to reinstall everything again.

  • Options
    whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @pwolfe

    The issue is that Vanilla can't log in to the DB for your forum, so you shouldn't need to reinstall.

    Try adding a new user to your DB (using MySQL Databases in cPanel on my host.)

    Then change the config.php info to match the new user and password.

    If it still can't connect to your DB then I would contact your host to get them to check why you can't connect to the DB.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    You do not have to reinstall. I agree with Shadowdares assumption that your db settings in the config are messed up. Check those four lines and make sure they show the right values:

    // Database
    $Configuration['Database']['Name'] = 'your_database_name';
    $Configuration['Database']['Host'] = 'your_db_host';
    $Configuration['Database']['User'] = 'your_db_user';
    $Configuration['Database']['Password'] = 'your_db_password';
    
  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited February 2014

    This exact thing has happened to me at least 3 times in the whole time I have been using Vanilla, and Wordpress.
    Any app that uses a data base can get disconnected. Then when you go to myadminphp to see the data base it asks for a password when normally it would simply log me in.

    I contacted my host all these times. They were baffled as well. This however is not caused by vanilla or the config.php . According to the host, it was an attack of requests that flooded the server and disconnected the data bases. All of them. 8 databases disconnected.

    I do not think so, I don't get much traffic. It surely has something to do with the host side of things. The next day they would write me back saying that it all works fine. I am not sure what they did if anything or if it sorted itself out.

    I would contact the host and tell them that you got disconnected from the database. Maybe they can look into it. Hopefully it will sort itself out.

    I did not have to change any passwords. But the when I did try to change it , it did not let me change it. That is a sure sign that the problem is with host.

  • Options
    peregrineperegrine MVP
    edited February 2014

    @pwolfe said:
    The username and password were never changed. The error started appearing when I tried editing the config.php file to redirect users to a different email confirmation url within my embedded Wordpress theme. When I made the changes I saw the error, then I went back to the config.php file and reverted it back to the old version, but the error still wouldn't go away. Not sure why it keeps appearing since I never had any problems with it before.

    I'd hate to have to reinstall everything again.

    @pwolfe said:

    SQLSTATE[28000] [1045] Access denied for user 'young_vani834'@'localhost' (using password: YES)

    $Configuration['Database']['User']

    young_vani834 theoretically is the user in your config.php. and the one you used during installation. If that is not the case you munged something up.

    you can verify if you can login with that user name with phpmyadmin and
    using the password in your config.php

    mysql -u young_vani834 -p

    if you can login correctly using phpmyadmin or mysql. your database name may be incorrect.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    When I check the config.php file, I see that the database name AND username is 'young_vani834'.

    However, when I login to cPanel... under MySQL Databases I see that the database name AND username is 'young_vani446'.

    So... I tried changing the info in the config.php file to 'young_vani446' so that everything matches up. That didn't work either. Is there something I missed that's obvious to fix it? Maybe it is a hosting issue as vrijvlinder said.

  • Options
    peregrineperegrine MVP
    edited February 2014

    Option A

    You need to verify by logging into the database with a username and password via some method as indicated above phpmyadmin or mysql.

    if you were successful.

    Then make sure the config.php matches the info you entered.

    Option B

    if you are unsuccessful - reread wu606's suggestion

    and repeat.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    pwolfepwolfe New
    edited February 2014

    @whu606 said:
    pwolfe

    The issue is that Vanilla can't log in to the DB for your forum, so you shouldn't need to reinstall.

    Try adding a new user to your DB (using MySQL Databases in cPanel on my host.)

    Then change the config.php info to match the new user and password.

    If it still can't connect to your DB then I would contact your host to get them to check why you can't connect to the DB.

    I tried adding a new user (as whu606 said) and now I no longer get the BONK error so that's progress. The only problem now is that my custom CSS has reverted back to the original -- though this can be changed easily enough. Not sure why the old database name even appeared in the first place since I never changed anything before when it was working under the old one.

  • Options
    peregrineperegrine MVP
    edited February 2014

    Take a little time and re-read what you said through out the discussion.

    The error started appearing when I tried editing the config.php file to redirect users to a different email confirmation url within my embedded Wordpress theme. When I made the changes I saw the error, then I went back to the config.php file and reverted it back to the old version, but the error

    The only problem now is that my custom CSS has reverted back to the original -

    both of these could have occurred if you made a mistakes with copies of config.php

    trying to understand what happened is futility.

    the problems did start occurring after you modified config.php. it could be your host, but I would not suspect the host based on your sequence of errors. check you theme in the dashboard and make sure you have the theme you think have is the one you are actually using.

    just move forward.

    maybe you thought you were changing email and actually changed the username for the database, and one error became a sequence of errors.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Thanks for the help. The custom CSS actually is okay on the embedded theme that I modified. All I had to do was switch to the embedded theme again and everything appears as it should. Relieved!

  • Options
    pwolfepwolfe New
    edited February 2014

    Resolved!

Sign In or Register to comment.