• Hi,

    From some month i use wordpress for my blog. Yesterday i got this error ” error establishing database connection”.
    – I updated my wordpress version to 4.8 but still does not work.
    – I restarted my VPS but still does not work.
    – I checked wp-config.php and all data are ok.

    I tried with define(‘WP_ALLOW_REPAIR’, true); and i got this message for database:
    wp_posts is not ok

    How can i solve this problem? I have already tried to repair the table but nothing..

Viewing 3 replies - 1 through 3 (of 3 total)
  • 1. first check mysql is up or not
    2. try rename your plugins folder
    3. create a new php file and test the database connection

    Thread Starter samu999

    (@samu999)

    Hi,

    Thank you for your answer.
    1) I tried to start again mysql and got this message:
    [ ok ] Starting mysql (via systemctl): mysql.service.

    2) I renamed the plugin folder, restarted the server but nothing.

    3) Can you tell me more informations?

    read this to test the mysql connection in https://gist.github.com/chales/11359952

    if the connection works, then the problem with your wordpress
    if not, then the problem with you mysql server.
    and of course check the if the mysql credentials are correct in wp-config.php

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