• I am using Windows7 .I am trying to install WordPress both on my PC and Laptop ,but getting the following Error

    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?

    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    In nutshell, you’re getting this error because WP is unable to establish a database connection. Reason why WP is unable to establish a database connection can vary. It could be that your database login credentials are wrong or have been changed. It could be that your database server is unresponsive. It could be that your database has been corrupted. Majority of the times this error happens because of some sort of server error. Also, there could be other factors as well.

    To troubleshooting this problem:
    – double check your wp-config.php file settings for the database name, database username and database password, and the host name (e.g., “localhost” Vs. something else). This is where most errors occur.
    – Then make sure wp-config.php is in right location.
    – Then check that you don’t need to change the database host from “localhost” to something else. You can get that info from your hosting provider.
    – Check you have actually created a database with the same database name as is in your wp-config.php file.
    – Last, but not least, if all that information is correct your database probably has a problem with it. Contact your hosting provider if the database server is offline (if the problem suddenly happened), or if they have any other problem at their end, or they made any changes to your account, or if there are any limitations/restrictions, or if the hosting package is set to Windows and not Linux, etc.
    – There are also many threads on this topic on these forums: https://www.ads-software.com/search/Error+establishing+a+database+connection?forums=1

    Thread Starter manjit126

    (@manjit126)

    Both the servers are running
    8:16:29 PM [main] Initializing Control Panel
    8:16:29 PM [main] Windows Version: Windows 7 Ultimate SP1 32-bit
    8:16:29 PM [main] XAMPP Version: 5.6.14
    8:16:29 PM [main] Control Panel Version: 3.2.1 [ Compiled: May 7th 2013 ]
    8:16:29 PM [main] Running with Administrator rights – good!
    8:16:29 PM [main] XAMPP Installation Directory: “c:\xampp\”
    8:16:29 PM [main] Checking for prerequisites
    8:16:32 PM [main] All prerequisites found
    8:16:32 PM [main] Initializing Modules
    8:16:32 PM [Apache] XAMPP Apache is already running on port 80
    8:16:32 PM [Apache] XAMPP Apache is already running on port 443
    8:16:32 PM [mysql] XAMPP MySQL is already running on port 3306
    8:16:32 PM [main] Enabling autostart for module “Apache”
    8:16:32 PM [main] Enabling autostart for module “MySQL”
    8:16:32 PM [main] Starting Check-Timer
    8:16:32 PM [main] Control Panel Ready
    8:16:33 PM [Apache] Autostart aborted: Apache is already running
    8:16:33 PM [mysql] Autostart aborted: MySQL is already running

    Dion

    (@diondesigns)

    Did you create the database you specified in the wp-config.php file? WordPress cannot create databases on its owm; you must do it manually.

    If that does not solve your problem, check your XAMPP documentation for how to specify the MySQL host/port. You may be required to specify localhost:3306 and not just localhost.

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