WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help - error establishing a database connection. (14 posts)

  1. whistlingb
    Member
    Posted 6 years ago #

    Hi -
    First off, an apology for a problem that might lie in my lack of insight into the exact basics needed to get wordpress up and running.
    I followed the steps in th cPanel section to create a database and a user name in MySQL. I don't have cPanel but used the tools provided by my hosting service, http://www.successfulhosting.com to do the same.
    I use Filezilla as ftp.
    I am unsure of how to find the cause of the error message:
    error establishing a database connection.
    I double checked database name and user name and changed my password.
    Advice would be appreciated.
    My hosting service does have phpMyAdmin installed but that appears to be out of my current realm of comprehension.
    I realize that there I am not providing much info to go on but thought some more general advice/ scenarios might get me looking in the right direction.
    My main goal is just to add a blog to my website. This is the first time I have tried to do so. It's not feeling within reach even i will admit. I will continue to hack away at it nonetheless. Success would be a great thing, i will admit.
    thanks anyone...

  2. MichaelH
    Member
    Posted 6 years ago #

    Most times, that errors mean you do have the wrong value for one of the 'define' statements in wp-config.php.

    Also, make sure that you give your DB_USER all the privileges to the database (DB_NAME). Sometimes this might be as simple as saying your user is the DBA (database administrator). Note: your host looks to use Hsphere for a control panel so do make sure the user is set as the DBA.

  3. obscure
    Member
    Posted 6 years ago #

    As MichaelH says 99.99999% chance you have entered the wrong information into your wp-config.php (or not uploaded it to the correct place). The most common mistakes are:

    1. Adding an extra blank space before after the User name or DB name or password

    define('DB_NAME', 'myDBname'); Correct
    define('DB_NAME', ' myDBname'); Incorrect

    2. Missing the ' before after the User name, DB name or password

    define('DB_NAME', 'myDBname'); Correct
    define('DB_NAME', myDBname); Incorrect

    3. Having 'Localhost" as the DB host when your ISP actually uses a separate DB hosting server. You may need to double check this with your host.

  4. whistlingb
    Member
    Posted 6 years ago #

    Thanks for the quick reply and suggestions.
    I have checked my define statements carefully. They are exactly the same as the values created in Hsphere.
    I double checked to make sure the user has full pivelages (DBA).
    I can't seem to get any further than that error message.
    Anything else you can think of that it might be?

  5. whistlingb
    Member
    Posted 6 years ago #

    My last reply was made before noticing the other responses to my query.
    I will try out those sufggestions before writing again.
    Many thanks everyone. I have new hope.

  6. moshu
    Member
    Posted 6 years ago #

    Which error message did you get? There are more than one, depending on what is wrong!

  7. whistlingb
    Member
    Posted 6 years ago #

    error establishing a database connection

  8. moshu
    Member
    Posted 6 years ago #

    All of them start like that...
    When you are asked to provide details - just do that!

  9. whistlingb
    Member
    Posted 6 years ago #

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.

    • Are you sure you have the correct username and password?
    • Are you sure that you have typed the correct hostname?
    • Are you sure that the database server is running?

    If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    that's exactly what it says...

  10. moshu
    Member
    Posted 6 years ago #

    There is nothing else we could think about but this:

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost.

    Which means either the user/wp combo or the db hostname/server is NOT correct in your wp-config file.

  11. whistlingb
    Member
    Posted 6 years ago #

    Well,
    thank you for trying to help and for your time.

  12. MichaelH
    Member
    Posted 6 years ago #

    Might consider submitting a request here:
    http://install4free.wordpress.net

  13. whistlingb
    Member
    Posted 6 years ago #

    I wanted to mention that a few hours later I figured it out, so to speak. (Actually, suggested by obscure as something to check out)
    I was informed by my hosting service that my mysql server is setup remotely and was given an IP address to replace 'localhost'in the wp-config file.
    Thanks.

  14. obscure
    Member
    Posted 6 years ago #


    I was informed by my hosting service that my mysql server is setup remotely and was given an IP address to replace 'localhost'in the wp-config file.

    Yep wrong host name is getting more common. Localhost was the norm originally but i think more and more hosts are moving the database workload off the servers that the actual web sites are served from. People don't spot the info in the hosting FAQs and so go with Localhost.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.