Title: Database problems
Last modified: August 31, 2016

---

# Database problems

 *  Resolved [72brb](https://wordpress.org/support/users/72brb/)
 * (@72brb)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/)
 * Working on MAMP localhost, my site crashed and I am locked out (white screen 
   front and back end). I tried to recover with a sql dump, but it didn’t work —
   it just sent me to a wordpress install screen and then installed its usual collection
   of tables in addition to the existing ones. I deleted them, so it sent me again
   to the install screen.
 * I therefore dragged a copy of the folder from a backup clone of my computer to
   the MAMP db/mysql –something I have done before when moving to a new computer
   with no problem. But this time, I got “cannot make a database connection. “
 * WordPress offered to repair it and I clicked okay, but it came back with “client
   is using or hasn’t closed the table properly” on 7 tables, as well as that the
   options table does not exist.
 * I did the repair routine in phpmyadmin for the 7 tables, though I am not sure
   how that is different from what wordpress had done in the error screen.
 * I looked at a number of posts here on the topic, but didn’t understand the discussion.
   Is there a way to insert the options table back? Or is this database gone? The
   options table is listed in the left panel of phpmyadmin, so I don’t understand
   what happened to it.
 * I really don’t understand why the database is even broken. This backup is from
   several days before the crash.
 * Any insight or advice would be greatly appreciated.

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

 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/#post-7236363)
 * Hi
 * Sorry to hear your having problems with the database. If you have a good backup
   of your database I would 1.) go into PHPMyAdmin and delete all tables. Tables
   only not the database. 2.) I would import the backed up sql file. 3.) made sure
   that the database has the right url in options table. 4.) made sure that wp-config.
   php has the right database url (localhost normally), database name, database 
   user, database password. Also it’s good to check that under PHPMyAdmin privileges
   your user has right permissions set.
 * After that just reload the site and see if it works. It might or might not ask
   to update the database. If it does, proceed with updating.
 * If properly import and the backup was properly exported, deleting all tables 
   and reloading new DB file will make sure that your not just loading stuff into
   a corrupt table but you have a fresh new one.
 * Hope that helps, let us know.
 * Thank you
    Artur
 *  Thread Starter [72brb](https://wordpress.org/support/users/72brb/)
 * (@72brb)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/#post-7236374)
 * Thanks for this, but I’m beginning to think that the problem is I was working
   from a Duplicator “clone” from a site originally on Godaddy, and for whatever
   reason Godaddy added 3 tables that don’t exist in a standard WordPress installation(
   with some added gibberish in the names. (wp_njfrfkmccp_cfs_sessions, wp_njfrfkmccp_cfs_values
   and wp_njfrfkmccp_cms2cms_options– all the tables are named that way), so when
   I tried to upload the sql backup to the empty database, I got an error in the
   SQL query that the first one (cfs_sessions) doesn’t exist.
 * This is a SQL backup of this particular database, why would anything not exist?
 * And if they don’t exist, why do they persist in the listing on the left panel
   of phpmyadmin? They’re still there after I deleted all the tables per your advice,
   the 3 non-standard one and the wp_njfrfkmccp_options.
 * Is there a way to delete the “listing” of those non-existent tables from the 
   left panel/from the database so it doesn’t go searching for them?
 * I also tried to export the database as an xml file and importing it to a new 
   installation of wordpress, but wordpress didn’t recognize it as an xml file, 
   it thought it was something else (I can’t remember the extension it thought it
   was). Seems like it’s not the same as importing an export that was created from
   within the dashboard.
 * Just wondering (sigh).
 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/#post-7236377)
 * Well unless your exporting more then one thing, like an export from WordPress.
   com would be a zip file but the normal or any import file of WordPress export
   would be .xml no matter what.
 * One option you have local or not, delete the database completely, not just the
   tables since some old godaddy tables are not being deleted.
 * Then create a brand new database with a new name, new user with new password.
   Update wp-config.php file with the new info a d import the sql file into that
   database with what I said above.
 * I don’t think I ever had PHPMyAdmin not remove a table. Actually, you can run
   a queries in PHPMyAdmin to just remove that table if checking it off and drop
   doesn’t work.
 * Hope that helps.
    Artur
 *  Thread Starter [72brb](https://wordpress.org/support/users/72brb/)
 * (@72brb)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/#post-7236382)
 * Thanks, I’ll have to give it a shot tomorrow, it’s late where I am. I would prefer
   xml, because I’d rather lose those weird tables, but I’m not imagining it — I
   made a point to select xml in the export page on phpmyadmin, and wordpress did
   not recognize it as a file it could import.
 *  Thread Starter [72brb](https://wordpress.org/support/users/72brb/)
 * (@72brb)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/#post-7236454)
 * This worked: A new database from the SQL backup. I basically got it up and running,
   then exported it to a clean install of WordPress to get rid of those weird tables.(
   Oddly, I tried a new database before posting here but I was probably not doing
   it right, didn’t have a clear idea of what I was trying to achieve.)
 * Thank you very much.
 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/#post-7236464)
 * Hi [@72brb](https://wordpress.org/support/users/72brb/),
 * You are welcome. I am glad to see that worked for you and everything is back 
   to normal.
 * Thank you,
    Artur

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

The topic ‘Database problems’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/database-problems-29/#post-7236464)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
