WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing a database connection (8 posts)

  1. kodak3000
    Member
    Posted 4 years ago #

    hi! as the title says my subject, I get the domain that I think and get into wp-admin/install.php and I get the following:
    Establishing a database connection error
    This either means that the username and password information in your wp-config.php file is incorrect or we can not contact the database server at mysql12.000webhost.com. 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.

    review the file wp-config and there was nothing wrong

  2. henkholland
    Member
    Posted 4 years ago #

    How did you install the wp-files? Throug a script at your host, then ask them what went wrong?
    Through FTP? Did you install in a sub-folder?

  3. fjordie999
    Member
    Posted 4 years ago #

    I had this same problem. I added another user to the database and edited my wp-config.php to use the new user and password. Then it worked!

  4. Kailash
    Member
    Posted 4 years ago #

    If you have created database and assigned proper permissions to mysql user then you should not face any problem. If you are sure you have entered correct information, I suggest you to contact your hosting provider to resolve this.

    Kailash

  5. lockheartmac
    Member
    Posted 4 years ago #

    I am having the same problem on my localhost machine. I am using a mac mini with php 5 and mysql 5. I can connect with Sequel Pro, Querious, and even through the terminal with the mysql command but everything in the browser says "Error establishing a database connection".

    I tried using root. I created a new user and granted all the proper privileges. I have created and deleted the target database multiple times, but nothing is working. Does anyone know anything else I can try?

  6. ben.blodgett
    Member
    Posted 4 years ago #

    I would try changing localhost to the actual ip of the mysql database, in my experience wordpress installations run a lot smoother when you define the ip address instead of localhost.

  7. lockheartmac
    Member
    Posted 4 years ago #

    I have already tried all of these solutions. I was able to google an answer to my problem. In short, the default installation of php5 on Mac OS X seems to point to the wrong MySQL socket. The location in the php.ini file points to a path that does not exist. Thanks Lloyd Budd!

    Mac, WordPress: “Error establishing a database connection”

  8. Lloyd Budd

    Posted 4 years ago #

    lockheartmac, thanks for closing the loop. It's great to hear you are out of the gate!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.