Title: Error establishing a database connection
Last modified: August 20, 2016

---

# Error establishing a database connection

 *  Resolved [Artylady](https://wordpress.org/support/users/artylady/)
 * (@artylady)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/)
 * I have been going around and around in circles with this one.
 * Yes my DB Hame is correct
    Yes DB User name is correct Yes DB password is correct
   Yes I am supposed to use localhost Yes the MySQL database is working and the 
   database server is working. All is as I normally do and have done successfully
   in the past with other sites on the same dedicated server. Other WP websites 
   using this particular version of WP are still working fine.
 * Tried installing older version of WP and still no joy.
 * I have contacted the people who look after our server and our settings are correct.
 * Any thoughts please – getting fairly desperate to figure it out.

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Pipe Ten Hosting](https://wordpress.org/support/users/pipetenhosting/)
 * (@pipetenhosting)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564235)
 * Hi Artylady,
 * Could you let us know if this is a new installation or an existing one?
 * Also a URL to said site if possible?
 * Kind regards
    Jamie
 *  Thread Starter [Artylady](https://wordpress.org/support/users/artylady/)
 * (@artylady)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564236)
 * Hi Jamie
 * It is a new installation – [http://www.guilt-edged.com](http://www.guilt-edged.com)
 * Many thanks
 *  [Pipe Ten Hosting](https://wordpress.org/support/users/pipetenhosting/)
 * (@pipetenhosting)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564252)
 * Hi Artylady,
 * I cannot replicate your lack of database connection issue. I can see that it 
   looks like the default wp-config.php is missing, so the WordPress install is 
   asking to create this.
 * The next page should ask you for your database details then assuming you have
   the correct write permissions edit the wp-config.php file for you.
 * See this image: [http://i.imgur.com/3bw78TM.png](http://i.imgur.com/3bw78TM.png)
 * Kind regards
    Jamie
 *  Thread Starter [Artylady](https://wordpress.org/support/users/artylady/)
 * (@artylady)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564263)
 * Yep – been through all of that.
 * I have edited the config file manually as well as working through the wp set 
   up process – neither work.
 * And I know get this error message ….
 * > Fatal error: Call to undefined function wp_load_translations_early() in /home/
   > gedged/public_html/wp-load.php on line 51
 * I am just about to delete the lot and start again but this time use a different
   route to upload. Will go back to the latest version too.
 *  [Pipe Ten Hosting](https://wordpress.org/support/users/pipetenhosting/)
 * (@pipetenhosting)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564273)
 * Hi Artylady,
 * It looks like the installation files haven’t been uploaded correctly. I would
   do what you suggested, delete the lot, re-upload and reinstall.
 * Kind regards
    Jamie
 *  Thread Starter [Artylady](https://wordpress.org/support/users/artylady/)
 * (@artylady)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564295)
 * Done that – that didn’t work either. I had to edit the config file manually as
   the software couldn’t do it and that didn’t work either.
 * So what’s next?
 * I know that it is bound to be one of those infuriating things that once you spot
   it, you go ‘doh – why didn’t I see that before?’
 * Having recreated the database too, and tried various log in options suggested
   by others (despite not having had to do that before), I am beginning to wonder
   if it is something to do with the server.
 * Any suggestions on what to check would be really, really appreciated.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564297)
 * >  had to edit the config file manually as the software couldn’t do it
 * Can you elaborate on this? why couldn’t WordPress create the wp-config.php file
   for you? Have you triple checked all of your database details with your hosts?
   The most common mistake is usually to do with the database hostname as this is
   rarely intuitive.
 *  Thread Starter [Artylady](https://wordpress.org/support/users/artylady/)
 * (@artylady)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564314)
 * Thanks esmi
 * I set up the database myself (which of course is no guarantee of anything) using
   CPanel – as I have done in the past.
 * Normally it is set to localhost – and I have double checked other config files
   of other sites – and it is the same.
 * I have also double checked with the guys who manage our server and yes it should
   be localhost.
 * I have also tried the ip address of the server as someone suggested elsewhere
   but that didn’t work either.
 * WordPress didn’t create the config file when it couldn’t connect to the database
   and came up with the error message stating – please check the database details
   again.
 * I assume that if I can log into phpMyAdmin that the database server is running
   too.
 *  Thread Starter [Artylady](https://wordpress.org/support/users/artylady/)
 * (@artylady)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564341)
 * just double checked again what happens when it comes up with the database error
   message. I am wondering if there is a problem with the installation files.
 * When there is no config file – it goes to create a config file. If there is no
   config.sample.php file, it tells me which would suggest that that bit is reading
   the files as it should.
 * However when there is a config.sample.php file it is coming up with the database
   connection error but hasn’t edited or renamed the config.sample.php document.
   Not has it set up a config.php file. So would this mean that something is missing
   in the intall.php file?
 * Just a thought.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564350)
 * > If there is no config.sample.php file
 * If? There is _always_ a wp-config-sample.php file in every WordPress download.
 * What exactly is the database connection error message?
 *  Thread Starter [Artylady](https://wordpress.org/support/users/artylady/)
 * (@artylady)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564353)
 * Problem solved.
 * for some reason on this one occasion, out of loads of times doing this – I had
   set up the db differently and hadn’t linked the user to the database itself –
   somehow. Not sure how I did that but at least now I know that there isn’t a lost
   bug going on the rampage through the software or server.
 * I am now in and am doing what I need to do.
 * Thank you guys for your time and input anyway. It is very much appreciated.
 * So for anyone else experiencing this problem – make sure that the DB user is 
   actually linked to the Database you want to use! (doh!)

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Error establishing a database connection’ is closed to new replies.

## Tags

 * [database connection](https://wordpress.org/support/topic-tag/database-connection/)
 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)
 * [error establishing connection](https://wordpress.org/support/topic-tag/error-establishing-connection/)
 * [installation](https://wordpress.org/support/topic-tag/installation/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 11 replies
 * 3 participants
 * Last reply from: [Artylady](https://wordpress.org/support/users/artylady/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-467/#post-3564353)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
