• I logged into my site last night and noticed that it is down. The site was working perfectly fine when I was last on about a week ago. My first step was to contact my hosting company. They finally got back to me and told me today it looks like changes were made to my database. Which I did not do. I asked if they were able to see what was wrong with it and they proceeded to tell me that I was missing data from my wp_options table. They also told me that for them to fix it I would have to pay a developer of theirs to take a look at what is going on. I would really like to fix this myself.
    Ok so this is what I have done so far. I looked through all the tables can’t find anything obvious that is missing. I then ran the WordPress database repair tool it says all tables are good. I also changed my password for the database and updated my wp-config.php because I have noticed a lot of malware attempts lately my hosting even stopped one about a month ago. So now I don’t know where to go from here.
    Hosting: IONOS (formerly 1and1)
    Database version: MySQL 5.7
    Any other information needed please let me know. Thanks for any help in advance.

    • This topic was modified 5 years, 3 months ago by chriscms.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • lisa

    (@contentiskey)

    is the database password in wp-config the same one that is correct for your database credentials in your hosting plan?

    Thread Starter chriscms

    (@chriscms)

    Thanks for the response. Yes I updated the wp-config file when I changed the password in my hosting plan.

    lisa

    (@contentiskey)

    can you recheck all database credentials to be sure they match wp-config?

    Thread Starter chriscms

    (@chriscms)

    I am positive the wp-config is correct. This is not a new installation. I randomly lost the connection to the database. None of the credentials changed.

    Dion

    (@diondesigns)

    If the WP repair tool was able to run, then your database credentials are correct.

    The Error establishing a database connection message can occur even if WordPress was able to successfully connect to the database. (This really should be changed/fixed.) Please add the following two lines to your wp-config.php file:

    define('WP_SITEURL', 'https://www.chrisstallings.com');
    define('WP_HOME', 'https://www.chrisstallings.com');

    Does this change the error message? If so, then your hosting company was telling you the truth about missing data in the wp_options table.

    Thread Starter chriscms

    (@chriscms)

    Where should those lines be placed in the wp-config file?
    Also if this does not fix it how would I go about repairing the wp_options table if the wp repair tool says there is nothing wrong with that table?
    Thanks for the help

    K

    Dion

    (@diondesigns)

    The lines should be placed anywhere above the That's all, stop editing! Happy publishing. line.

    Thread Starter chriscms

    (@chriscms)

    Ok. So I updated the wp-config with the code and the error is still the same. So I am thinking it is the wp-options table. Is there a way to repair that without the wp repair tool since no issues were found using that?

    Dion

    (@diondesigns)

    You can check the status of the wp_options table if you have access to phpMyAdmin. If the table is missing or is empty, then you will need to replace it. Hopefully you have an old backup of your database that can be used for this purpose.

    Thread Starter chriscms

    (@chriscms)

    Does the table have to be from the same version of WordPress my site currently is? I have an old one but I doubt it’s the same version. Is there a way to check what version my site currently is with it down? Finally if it must be the same version can I create a fresh install and grab the table from that?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.