Title: SQL Hell &#8211; Error Establishing Database Connection
Last modified: August 19, 2016

---

# SQL Hell – Error Establishing Database Connection

 *  Resolved [lostrepublic](https://wordpress.org/support/users/lostrepublic/)
 * (@lostrepublic)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/sql-hell-error-establishing-database-connection/)
 * I realize this is a common topic. I’ve been working on the problem for a couple
   days with no luck. I’ve also spent a couple hours reading these and other forums.
   I don’t think I’ve found a solution.
 * My wp-config.php is correct. Trust me.
 * Here’s the situation:
 * 1) I had a working blog. [http://www.lostrepublic.us](http://www.lostrepublic.us)
   hosted with GoDaddy.com
    2) The database was called lostrepublic_us . I exported
   a 4.7 MB sql file. 3) I made some cosmetic changes to the SQL file (got rid of
   some garbage characters – Ã¢â‚¬â„¢ – that appeared next to hyphens and umlauts.)
   4) The process I’ve successfully used before for restoring a database is this:–
   make sure I have the original exported file as a backup – delete the database–
   create a blank database with the same name – import all the sql commands (minus
   the leading “create database”) 5) I tried and failed to restore the corrected
   database file. A few things went wrong. Worrying that I messed something up in
   cleaning out the garbage characters, all I’m trying to do now is restore the 
   original backup. Forget the edits, forget fixing the garbage characters. Please
   help me restore the original. 6) Two things seem to have gone wrong: a. I accidentally
   exported both my own database and “information_schema” which I’ve learned is 
   a system map of my database. b. GoDaddy will no longer let me create a database
   with an underscore character. 7) I don’t seem to have privileges to create “information_schema”
   on GoDaddy’s server. From what I’ve learned, I don’t think I need to. The system
   creates that database. Right? The .sql file breaks up evenly into my database,
   and the information_schema database. I simply deleted the information_schema,
   and tried importing the rest. It imports successfully. 8) Since GoDaddy no longer
   lets me create lostrepublic_us, I created lostrepublicus. In the .sql file, I
   did a simple text replace. The file imports successfully. I also updated the 
   wp-config file to reflect the vanished “_”. 9) Even though the file imports, 
   I get the common “Error Establishing Database Connection”
 * Incidentally, I can import either database successfully – the one in which I 
   fixed the garbage characters, or the original backup, but either way I get the
   message “Error Establishing Database Connection.”
 * I’m beginning to get desperate. Any help would be very much appreciated. Thanks.

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

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/sql-hell-error-establishing-database-connection/#post-1166604)
 * hmmm…personally I would do a completely fresh install of wordpress and let it
   create the default tables
    then do the import from the zipped .sql file
 * if that doesn’t work, email me and I’ll try to help out cause godaddy is a huge
   pain these days
    sbollinger at comeuphither dot com
 *  Thread Starter [lostrepublic](https://wordpress.org/support/users/lostrepublic/)
 * (@lostrepublic)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/sql-hell-error-establishing-database-connection/#post-1166743)
 * Samboll,
 * I am impressed and humbled by your prompt, thoughtful reply. If you’re ever passing
   through Iowa City, I’ll buy you a beer.
 * I think something was screwy at GoDaddy. I went to bed last night with my original
   database imported, but still getting the “cannot establish database connection”
   error. I was planning to follow your advice this morning.
 * This morning, to my surprise, my website was working fine.
 * I tried uploading my fixed sql file, the one with garbage characters removed,
   and now that’s working.
 * I didn’t do anything that I haven’t been trying for the past two days.
 * I don’t know what the deal is, but I’m glad to be up again.
 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/sql-hell-error-establishing-database-connection/#post-1166756)
 * :>)
    man you gotta’ love the ‘net

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

The topic ‘SQL Hell – Error Establishing Database Connection’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [database connection](https://wordpress.org/support/topic-tag/database-connection/)
 * [export](https://wordpress.org/support/topic-tag/export/)
 * [godaddy](https://wordpress.org/support/topic-tag/godaddy/)
 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Samuel B](https://wordpress.org/support/users/samboll/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/sql-hell-error-establishing-database-connection/#post-1166756)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
