Title: database error &#8211; aagh!
Last modified: August 20, 2016

---

# database error – aagh!

 *  [redlid](https://wordpress.org/support/users/redlid/)
 * (@redlid)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/)
 * Not sure what I did, or whether I did it. But I get this error
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/buderimq/public_html/wp-config.php:2) in /home/buderimq/public_html/
   wp-includes/functions.php on line 3286
 * This is after the thing threw an error saying the database needed a repair and
   to add a line of code to the config.php file, then click “repair” . . . it did
   all this, said all was good but puts this error at the top of the page. Any page
   you try to go to says the same thing.
 * Help! Does anyone have any idea how I can I recover from this?

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

 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291470)
 * Change the theme to the default un-modified theme and see if you still get the
   error.
 * Did you activate any new themes or plugins before the error, if so disable them?
 * **Warning: Cannot modify header information**
    This is often theme or plugin 
   related, whitespace, empty lines or a closing tag at the end of **functions.php**,
   or a whitespace or a missing closing php tag in a plugin or theme file.
 * The file functions.php is the only theme file where the file should **not** have
   a closing php tag `?>`
 * Also whitespace, empty lines os missing closing php tag at the end of an edited
   file can cause this, if you have edited any files then check for whitespace, 
   empty lines or missing closing php tags `?>` at the end of the files, to do this
   in your editor select all and look at the end of the file.
 * HTH
 * David
 *  Thread Starter [redlid](https://wordpress.org/support/users/redlid/)
 * (@redlid)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291471)
 * Yeah, I can’t even log into to see anything to disable. I was playing about with
   a plugin and must have broken it. I ftp’d in and deleted the plugin directory
   but I fear it has jiggered something else up!
 * I did not touch any other files
 * I looked in the functions.php and see the missing ?> and left it.
 * Man I am freaking as we put a heap of work into this and am terrified it is lost
 *  Thread Starter [redlid](https://wordpress.org/support/users/redlid/)
 * (@redlid)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291472)
 * OK I went in and saw a space before the opening php in the wp-config file and
   fixed it. Then it came up with this . . .
    One or more database tables are unavailable.
   The database may need to be repaired.
 * The word repaired was a link, so I clicked it and it said add a line to the wp-
   config file and reload the page.
 * define(‘WP_ALLOW_REPAIR’, true);
 * I did this and it ran through some stuff and it said all is good. So I reloaded
   the wp-admin page and now the error simply states in big black letters . . .
   
   Error establishing a database connection
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291473)
 * These are just suggestions, I am not that up on this part of WordPress, just 
   what I would do.
 * If I have backend MSQL access check the database, check with my ISP if they can
   restore the whole website and database to a specified time from a last good backup,
   they should have incremental backups.
 * Other Options:
    Check the MYSQL Connection strings in wp-config.php are correct.
 * Maybe save the wp-config.php as wp-config.old backup the database, and see if
   the setup runs again when I run the website, recreates the wp-config.php file
   for me, and if I can then connect to admin and the database.
 * HTH
 * David
 *  Thread Starter [redlid](https://wordpress.org/support/users/redlid/)
 * (@redlid)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291474)
 * Here’s what the “repair” page said . . .
 * The wp_users table is okay.
 * The wp_usermeta table is okay.
 * The wp_posts table is okay.
 * The wp_comments table is okay.
 * The wp_links table is okay.
 * The wp_options table is okay.
 * The wp_postmeta table is okay.
 * The wp_terms table is okay.
 * The wp_term_taxonomy table is okay.
 * The wp_term_relationships table is okay.
 * The wp_commentmeta table is okay.
 * Repairs complete. Please remove the following line from wp-config.php to prevent
   this page from being used by unauthorized users.
    define(‘WP_ALLOW_REPAIR’, true);
 * So it says all is good, but when I remove the allow repair line in wp-config.
   php it throws the database error line.
 * Any clues?
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291475)
 * It looks like it only checks the wp- tables, it could be the bad plugin added
   code to wp-config.php or to .htaccess, check these files.
 * Check the MYSQL Connection strings in wp-config.php are correct, and for any 
   whitespace.
 * HTH
 * David
 *  Thread Starter [redlid](https://wordpress.org/support/users/redlid/)
 * (@redlid)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291477)
 * Thanks for your help Dave, I really appreciate it.
    Will see if the host can 
   restore the database
 *  Thread Starter [redlid](https://wordpress.org/support/users/redlid/)
 * (@redlid)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291480)
 * Just found out they did a total backup 10 hours ago, so I will just wipe it out
   and start again. sigh

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

The topic ‘database error – aagh!’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 2 participants
 * Last reply from: [redlid](https://wordpress.org/support/users/redlid/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/database-error-aagh/#post-2291480)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
