WordPress: Error establishing a database connection

Solution:1

This blunder essentially implies that the qualifications given in the wp-config document don’t coordinate to your data set subtleties. I should pressure that these subtleties are totally different from your server subtleties.
It’s not totally clear what you depend on so I will begin from the start to make your site ready once more. To start with, I need you to rename your current wp-config.php record to something like wp-config.php.old (the name doesn’t make any difference).
Then, at that point, make a new wp-config.php document with the accompanying inside:

/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don’t have to use the web site, you can
* copy this file to “wp-config.php” and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘database_name_here’);

/** MySQL database username */
define(‘DB_USER’, ‘username_here’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘password_here’);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);

/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);

/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-
key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This
will force all users to have to log in again.
*
* @since 2.6.0
*/
define(‘AUTH_KEY’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);
define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’);
define(‘NONCE_KEY’, ‘put your unique phrase here’);
define(‘AUTH_SALT’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_SALT’, ‘put your unique phrase here’);
define(‘LOGGED_IN_SALT’, ‘put your unique phrase here’);
define(‘NONCE_SALT’, ‘put your unique phrase here’);

/**#@-*/

/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = ‘wp_’;

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define(‘WP_DEBUG’, false);

/* That’s all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined(‘ABSPATH’) )
define(‘ABSPATH’, dirname(__FILE__) . ‘/’);

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);

Then, you should figure out the right subtleties.
At the point when you sign into your server, you ought to have the option to get to the data set by means of phpMyAdmin or something almost identical. Most servers will permit you in without having to login to the data set. When you’re in, you should make another client for your data set. This is the very thing that will go into your username and secret key fields in the wp-config record.
Ensure this client has ALL honors or it won’t work.
The name of your information base will go in the data set field and the hostname is typically ‘localhost’ yet you might have to contact your facilitating on the off chance that this doesn’t work.
I have heard that the hostname may be your site’s URL however I’m uncertain about whether that is exact or not.

I trust this furnishes you with enough data to get your site in the groove again. Inform me as to whether you experience additional issues and I’ll make an honest effort to take care of you!

Solution:2

Have a go at crippling your modules by doing an organizer rename and afterward check whether your site comes up once more. You can do the whole modules envelope or simply the one you believe is causing the issue. Do it from the backend document manager that you ought to approach ( all webhosts give this out as a matter of course for you to have the option to deal with the website’s records and envelopes )

Solution:3

Is it safe to say that you are ready to get to your phpmyadmin?
If not, you have arrived at your server memory assets limit.
You can change your bead size or advance the site. The majority of the cases it will just fix with advancing the site.