If you get the following error “Error establishing a database connection”

  1. Modify your wp-config.php and add the following line:
    define(‘WP_ALLOW_REPAIR’, true);
  2. Reload your website, usually under “wp-admin/maint/repair.php?”
  3. If the repairs didn’t go through and still get this message
    ” Some database problems could not be repaired. Please copy-and-paste the following list of errors to the WordPress support forums to get additional assistance. “
  4. Go to phpMyAdmin
    (1) Log in to your phpMyAdmin or connect to it via your web hosting (cPanel?) backend.
    (2) Select the database with the crashed table.
    (3) Put a checkmark next to each crashed table.
    (4) Select “Repair table” from the “With selected:” drop down at the bottom of the list.
  5. Reload website (it should work now)

    More info on: https://wordpress.org/support/topic/wp_options-table-is-marked-as-crashed-and-last-repair-failed-10/