• Hi there.

    My site went down unexpectedly at some point between 4pm-7pm yesterday, and I’m unable to access it either via the public (where it’ll state “Error establishing a database connection”), or behind-the-scenes via the WordPress dashboard. There it shows the following message.

    “Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

    Are you sure you have the correct username and password?
    Are you sure that you have typed the correct hostname?
    Are you sure that the database server is running?”

    I’ve logged into the cPanel via my host, which is Parallels Plesk Panel. Via the File Manager section and going into the root folder/path, I’m not able to locate the wp-config.php file at all, and in saying that I’m also struggling to find any other wp related files. However, upon reading this article, I’m hoping this is nothing major: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress

    Upon speaking with my hosts on their 24/7 support line, they stated trying to restart the server. They advised me that doing that would see 10-20 minutes downtime typically, but shouldn’t make any adjustments to any files stored on there.

    I’m not very tech savvy with all of this, so any help with minimal jargon would be HUGELY appreciated. Obviously I want to get things up and running again as soon as possible.

    Website: https://www.deadpress.co.uk

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Is the mysql server running? That’s the first thing you need to know.

    Thread Starter zredrup

    (@zredrup)

    Without wanting to sound like an imbecile, how do I go about checking that?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Can you access your database via phpmyadmin from the control panel? What does your hosting company say?

    Thread Starter zredrup

    (@zredrup)

    I can access the database via my hosts control panel. It’s not managed hosting, they just offer technical support. When I spoke to them they said they can’t enter the server directly. They can just give general advice, which was to restart the server.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    OK, so if the database is up. Within phpmyadmin, check all the tables to see if any are corrupt. Select all tables and choose check table from the dropdown

    View post on imgur.com

    Are you using a VPS or shared hosting?

    Thread Starter zredrup

    (@zredrup)

    These are all of the folders that are available to me as soon as I enter File Manager once I’ve logged in.

    I’m using a VPS.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    1) determine if mysql is running:

    ps -ef |grep mysql

    2) if it isn’t, start it

    sudo service mysql start (or maybe mysqld)

    3) if running,
    a) stop httpd — sudo service httpd stop
    b) check the database mysqlcheck -u root -p yourdatabasenamehere Are there any that are not OK?
    c) restart httpd — sudo service httpd start

    Thread Starter zredrup

    (@zredrup)

    I’m going to be honest and say I’m not 100% sure on how to do any of that. ??

    Thread Starter zredrup

    (@zredrup)

    Managed to find the wp-config.php file and download two copies (one for backup) – just don’t know how to go about finding the following info to adjust and correct if needed.

    define(‘DB_NAME’, ‘database-name’);
    define(‘DB_USER’, ‘database-username’);
    define(‘DB_PASSWORD’, ‘database-password’);
    define(‘DB_HOST’, ‘localhost’);

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