Error establishing database connection

Discussion in 'aMember Pro v.4' started by aydesign, Jul 14, 2013.

  1. aydesign

    aydesign New Member

    Joined:
    Jul 6, 2013
    Messages:
    10
    Basically have the same problem as this person:
    http://www.amember.com/forum/thread...password-and-now-cant-get-into-amember.16202/

    I have amember and my wordpress site connected.
    I just signed in to my hosting, and changed the passwords for MySQL and FTP accounts, and now I can't access amember, or my Wordpress site.

    When I go to my amember admin URL, I get:
    "Script error. Error establishing a database connection. Please contact site webmaster if this error does not disappear long time"

    When I go to my Wordpress site, I get:
    "Fatal error: SQLSTATE[28000] [1045] Access denied for user 'aydesign_User'@'localhost' (using password: YES) in /---/---/---/amember/library/Am/Lite.php on line 883
  2. aydesign

    aydesign New Member

    Joined:
    Jul 6, 2013
    Messages:
    10
  3. gswaim

    gswaim CGI-Central Partner

    Joined:
    Jul 2, 2003
    Messages:
    641
    You should change the data base (DB) password in the WordPress (WP) wp-config.php file. This is assuming you changed the WP DB password. You should have 2 DBs one for WP and one for aMember.
  4. aydesign

    aydesign New Member

    Joined:
    Jul 6, 2013
    Messages:
    10
    Thanks very much for your help!

    I had amember set up their program on my domain for me, I changed the password in /amember/application/configs/config.php , which originally had matched the password I gave them, as my mySQL database password.

    I just checked the wp-config.php file like you suggested, but I do not recognize the password that's currently listed there, so I'm hesitant to change it. Where do I actually go, to change that password? (i.e. where do I go, to enter that current password, and change it to a new one) Is it done from within the dashboard of my Wordpress site?
  5. gswaim

    gswaim CGI-Central Partner

    Joined:
    Jul 2, 2003
    Messages:
    641
    Just for the record, changing DB Username Passwords on a working system is not a good practice, but since this has happened here goes...

    In your original post you stated"
    This implies to me that you changed the password for both the aMember and WordPress DB. You also stated that you couldn't log into either program after these changes. Again this implies that you made changes that affected both programs.

    For clarification. You should had 2 DBs, one for WP and one for aMember. The password(s) are associated with a DB Username and you could use the same DB Username on both the aMember database and the aMember DB. This means you could have only one password for both DBs. Alternatively, you could have a different Username for each DB and therefore have different Passwords for each DB. I don't know how your installation is setup.

    If you open the WP installation and login, I wouldn't do anything else. However, if you do need to change the WordPress DB Username Password, you simply change the password in the wp-config.php file.

    Good Luck.
  6. aydesign

    aydesign New Member

    Joined:
    Jul 6, 2013
    Messages:
    10
    Okay, things seem to be working alright now, so I'll just leave things as is.

    What I meant was, I changed the two passwords here (red dots) Untitled-1 copy.jpg
    and after I did so, I got the two errors mentioned in my first post, when I tried to access both amember, and my Wordpress site

    "When I go to my amember admin URL, I get:
    "Script error. Error establishing a database connection. Please contact site webmaster if this error does not disappear long time"

    When I go to my Wordpress site, I get:
    "Fatal error: SQLSTATE[28000] [1045] Access denied for user 'aydesign_User'@'localhost' (using password: YES) in /---/---/---/amember/library/Am/Lite.php on line 883"

    After updating the " /amember/application/configs/config.php" file with the new MySQL password I got from here,
    Untitled-1 copy.jpg
    things seem to work fine again. I just wanted to make sure there wasn't anything else I needed to change, besides updating the password in "/amember/application/configs/config.php"

    The password that's listed in the wp-config.php file, I don't even know where that's from, I didn't give amember that password, and I didn't type that password in anywhere. I'm guessing it was something automatically created when I installed Wordpress?

    Anyways, yeah, everything seems to work alright now, so hopefully everything's okay.
    Thanks for taking the time to help/reply, very much appreciated
  7. alverdeja

    alverdeja New Member

    Joined:
    Sep 18, 2012
    Messages:
    18
    I reset my DB password and passed it to /amember/application/configs/config.php yet I'm still getting the same "Error establishing database connection". Any help?
  8. thehpmc

    thehpmc aMember Pro Customer

    Joined:
    Aug 24, 2006
    Messages:
    901
    Starting a new thread, rather than resurrecting one two years old, might have been a better idea but more importantly give a bit of relevant information.

    Is site aMember only or does it include Wordpress etc?
    Did site work previously?
    Why change passwords?
    Did changing passwords alone cause problem?

    Try creating a new user complete for your database and add those details to config.php

Share This Page