Support » Fixing WordPress » database connection error to wp-admin

  • Resolved Laura Landsiedel

    (@laura-landsiedel)


    Short of the long story –
    after re-establishing a database connection, you can now find my website online again. But, I still cannot access the wp-admin pages.
    type: http://www.handsonhealthnc.com or handsonhealthnc.com and you see my website. Type http://wordpress.handsonhealthnc.com/wp-login.php and you will get “error establishing a database connection”.

    Here’s the long version of the story:
    I attempted to create a new database so that I could upgrade wordpress to the new 3.2 version. A new database had to be created so that MySQL5.0 was established. All hookie broke loose after that and I called the host and asked them to file restore back 12 hrs to before the fiasco. That’s how we were able to get the website going again. Not only am I back to the original database with MySQL4.0, but I can’t tap in and work with wp-admin.

    Does anyone have any ideas?
    Thank you in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Have you checked your wp-config file? Make sure that the username, password, hostname, database name are all correct.

    Thread Starter Laura Landsiedel

    (@laura-landsiedel)

    I have been able to look at the wp-config file but I’m a bit timid about tampering with it again since the restore. I would go through the backup process prior to any tampering except I’ve already got the backup but couldn’t make the restore backup work properly so I don’t think that’s a safe solution for me.
    [Right now the database name is pointing to a database that no longer exists when you open in the database manager but does exist when you look at it via the file manager pro database folder…I’ve got a ticket in to try to resolve this problem (renaming/recreating the folder in database manager does not work).]

    Is it possible that a change of password might affect my access to wp-admin but not the viewing of the site? I know the old and new password so if you think it’d be safe to try changing the password, I could attempt that.

    I just went to http://handsonhealthnc.com/wp-admin/ and got the following message:

    We were able to connect to the database server (which means your username and password is okay) but not able to select the handsonhealthnc-1 database.

    Are you sure it exists?
    Does the user ********* have permission to use the ********-1 database?
    On some systems the name of your database is prefixed with your username, so it would be like username_******-1. Could that be the problem?

    So the problem is with your database name. Go to the url above to see your actual username database name in the message. I did not want to print them for public view.

    I would try changing the database name in your wp-config file to the new database name. BUT FIRST save a duplicate of the wp-config file or copy and paste the present wp-config file into another document and save it, just in case you want to change it back. If that does not work I would send the WP warning message above to your host and see if they can’t explain/fix the problem.

    And. It is strange that the frontend works but not the backend. Are you using a caching plugin?

    Hope this helps.

    Thread Starter Laura Landsiedel

    (@laura-landsiedel)

    Well let’s put it this way … before yesterday, the handsonhealthnc user did have permission to use that …..-1 database.
    I would definitely dig in and mess with the config file but I’m real hesitant to change anything yet.

    Answer to your question: I do believe I have a caching plugin. Oh crud … I wonder if all this happened b/c I didn’t disable plugins. Ugh. Wasn’t doing the typical export so that didn’t occur to me.

    Here’s another piece of the puzzle: it looks like the hosting company I use did an upgrade and now names all it’s files with long extensions that include the hosting name. My original database was created prior to the host’s upgrade. Maybe it doesn’t know how to go back. Probably gibberish to you but I’m a “2nd” grader chatting with an expert.

    So, I’ll go with you on changing the config file if all of what I said above does not send out alarm bells to you. 🙂

    Yes. You should change the database name in the wp-config file and see if it works.

    But, as I said, keep a copy of your present wp-config file so you have a backup.

    Thread Starter Laura Landsiedel

    (@laura-landsiedel)

    If you like this good mystery, here’s the gist of the conversation I’m having with the hosting site:
    When I look in the site’s File Manager Pro folder on the control panel, I see the database (….-1). When I look in the MySQL Database manager, the database file does not show up. It’s got to exist b/c they restored it last night.
    There does seem to be a file with “similar name” but with all the new file extensions …._1_….nc_site_aplus_net Last I heard, similar does not equal same.

    Thread Starter Laura Landsiedel

    (@laura-landsiedel)

    Thank you Danielwiener for all your help. Your suggestions helped me and also helped me learn a little bit more about how all this works.
    Topic closed.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘database connection error to wp-admin’ is closed to new replies.