Wednesday, January 7, 2015

Fix Establishing a Database Connection Error in WordPress


For WordPress beginner this type of error almost got and your site is not running till you install database and complete source code.
Establishing a Database Connection Error error you fetch when upload website or move website.
this type of error you got because of below mistake by you.
  • Check Database

    First check database if you local/live server than check all database table install properly or not.all WordPress database based on WP_option (WP is based on your table prefix) table so check that properly.
  • Check Config File

    In your source code of WordPress(Any version) open `wp-config.php` file in root wordpress folder in file check below lines configure with your data or not.

    define('DB_NAME', 'DBNAME');

    Here check DBNAME is your database name check your install database in MYSQL is same as below or not?

    define('DB_USER', 'UNAME');

    Here check your database user name which is given when create new DB or assign user to Databse in Local `root` is default value.

    define('DB_PASSWORD', 'PASSWORD');

    Here check your database User Password that you given when create below user.

    define('DB_HOST', 'HOST');

    Here you set host name of your MYSQL server where you put your database.most of case its `localhost`. 
After check below process your website run compactly. this method is use for any version of WordPress you use.

No comments :

Post a Comment