Title: Caught in endless database error loop
Last modified: August 20, 2016

---

# Caught in endless database error loop

 *  Resolved [nicknormal](https://wordpress.org/support/users/nicknormal/)
 * (@nicknormal)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/)
 * Overnight my database seems to have disconnected.
 * Upon going to my /wp-admin/ area I am given the following error:
 * > One or more database tables are unavailable. The database may need to be repaired.
 * I click ‘repaired’ and am given the options to ‘Repair Database’ or ‘Repair Database
   and Optimize’ – I click ‘Repair Database’ and then I get the following:
 * > To allow use of this page to automatically repair database problems, please
   > add the following line to your wp-config.php file. Once this line is added 
   > to your config, reload this page.
   >  define(‘WP_ALLOW_REPAIR’, true);
 * I modify wp-config, re-upload, force refresh and I am given the following:
 * > 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);
 * I remove the line, re-upload, ensuring there are now ‘garbage’ blank spaces or
   lines.
 * Upon going back to /wp-admin/ I am confront with the original error:
 * > One or more database tables are unavailable. The database may need to be repaired.
 * The whole process repeats.
 * Please advise! And thank you in advance.

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414148)
 * Try to repair your database through phpmyadmin: [http://codex.wordpress.org/FAQ_Troubleshooting#How_do_you_repair_a_MySQL_database_table.3F](http://codex.wordpress.org/FAQ_Troubleshooting#How_do_you_repair_a_MySQL_database_table.3F)
 * But make a database backup of what you have now first: [http://codex.wordpress.org/Backing_Up_Your_Database](http://codex.wordpress.org/Backing_Up_Your_Database)
 * Check if the database info is correct in wp-config.php.
 * Ask your host if they have a backup of your database from before the problem 
   first occurred.
 *  Thread Starter [nicknormal](https://wordpress.org/support/users/nicknormal/)
 * (@nicknormal)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414158)
 * hi keesiemeijer,
 * I have made a backup of my database – in cPanel’s MySQLDatabases tab it says 
   my database is 506.64MB; when I export the database via phpMyAdmin the file is
   only 67.7MB – does this sound faulty or correct?
 * I have tried ‘checks’ and ‘repairs’ of the database via phpMyAdmin and everything
   returns OK.
 * I currently have a support ticket with my host; this was on a managed dedicated
   server, not shared, so I’m not sure where the corruption took place. Everything
   was fine last night. Any other ideas on where I might look?
 * Thank you.
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414161)
 * > when I export the database via phpMyAdmin the file is only 67.7MB – does this
   > sound faulty or correct?
 * Maybe it’s a zipped file.
 * Here is a topic with the same problems: [http://wordpress.org/support/topic/error-establishing-a-database-connection-171?replies=20](http://wordpress.org/support/topic/error-establishing-a-database-connection-171?replies=20)
 * Some people got it working setting the home and site url to the correct value.
   maybe it helps if you set the home and site url to the correct values with one
   of these methods: [http://codex.wordpress.org/Changing_The_Site_URL](http://codex.wordpress.org/Changing_The_Site_URL)
 * WP_HOME – the address you want people to type in their browser to reach your 
   WordPress blog. It should include the http:// part and should not have a slash“/”
   at the end.
 * WP_SITEURL – The value defined is the address where your WordPress core files
   reside. It should include the http:// part too. Do not put a slash “/” at the
   end.
 *  Thread Starter [nicknormal](https://wordpress.org/support/users/nicknormal/)
 * (@nicknormal)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414165)
 * The file is uncompressed.
 * Thanks for the other topic’s tip; I noticed sidarcy recommends the following:
 * > UPDATE YOUR DATABASE NAME.wp_options SET option_value = ‘[http://YOURURL&#8217](http://YOURURL&#8217);
   > WHERE wp_options.option_id =2 LIMIT 1 ;
 * I know what he is referring to, and I actually DO NOT have a site URL option_value
   in my wp_options table!! Could this somehow be the problem? In fact, I don’t 
   have anything with option_id=2 – it’s unclear to me if I make a new option table
   if it MUST be id=2 or if any id number is okay, and the option_value is more 
   important?
 * I will avoid modifying the database until I hear back from the host, but it is
   good to know this might be something to troubleshoot.
 * Thanks.
 *  Thread Starter [nicknormal](https://wordpress.org/support/users/nicknormal/)
 * (@nicknormal)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414167)
 * okay I found option_name=home and it was #39; but I do not see option_name=siteurl
   which I see according to the [Changing the Site URL codex](http://codex.wordpress.org/Changing_The_Site_URL)
   should be in the database. Do you recommend inserting this option_name and option_value
   and if so, do you recommend a process to do this correctly?
 * THank you.
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414168)
 * > but I do not see option_name=siteurl
 * Did you look on page 2 or page 3 etc…
 * Try setting the correct urls with the functions.php method if this is not a multisite
   website.
 * Is this a [multisite](http://codex.wordpress.org/Create_A_Network)?
 * > I will avoid modifying the database until I hear back from the host, but it
   > is good to know this might be something to troubleshoot.
 * Yes, don’t edit the database directly before you hear from your host.
 * here are some more topics that might be useful to investigate: [http://www.google.com/search?q=site:http://wordpress.org/support/+define%28%27WP_ALLOW_REPAIR%27,+true%29%3B](http://www.google.com/search?q=site:http://wordpress.org/support/+define%28%27WP_ALLOW_REPAIR%27,+true%29%3B)
 *  Thread Starter [nicknormal](https://wordpress.org/support/users/nicknormal/)
 * (@nicknormal)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414170)
 * It is a single site; and I set phpMyAdmin to show all rows (598 total), so they’re
   all visible on one screen, and I organized numerically by option_id by clicking
   that column (which is how I found ‘home’ at #39).
 * I will edit and report back.
 * Thank you for your advice keesiemeijer – I want a Thanksgiving without any server
   errors!!
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414180)
 * Other things that are safe to try:
    – switching to the default theme by renaming
   your current theme’s folder in wp-content/themes using [FTP](http://codex.wordpress.org/FTP_Clients)
   or whatever file management application your host provides.
 * – [resetting the plugins folder](http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F)
   by using [FTP](http://codex.wordpress.org/FTP_Clients) or whatever file management
   application your host provides. Sometimes, an apparently inactive plugin can 
   still cause problems.
 * – re-uploading all files & folders – except the **wp-content folder** from a **
   fresh** download of WordPress. by using [FTP](http://codex.wordpress.org/FTP_Clients)
   or whatever file management application your host provides.
 * – renaming or deleting the [.htaccess](http://codex.wordpress.org/Using_Permalinks#Where.27s_my_.htaccess_file.3F)
   file by using [FTP](http://codex.wordpress.org/FTP_Clients) or whatever file 
   management application your host provides. If you delete it make a backup first.
 *  Thread Starter [nicknormal](https://wordpress.org/support/users/nicknormal/)
 * (@nicknormal)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414195)
 * Thank you for all your help keesiemeijer.
 * After some back and forth with the host, I had to resolve the issue myself. Luckily
   it wasn’t anything too drastic.
 * The MySQL database user’s privileges had become corrupt. I had to remove that
   user, add a new user, attach the new user to the database and then simply update
   my wp-config.php file with the new details.
 * I don’t know how the user’s privileges became corrupt, but I’m glad I didn’t 
   have to edit any tables or start messing with .htaccess etc. Sometimes the Internet
   is an absolute mystery! Case closed.
 * Cheers!
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414206)
 * You’re welcome. Glad you found a solution (and posted it here).

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

The topic ‘Caught in endless database error loop’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/caught-in-endless-database-error-loop/#post-2414206)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
