• MS Windows 7 (current updates)
    WAMP installed and running (i.e. able to access the phpMyAdmin page, add a DB and User)

    When trying to configure WordPress via the page: http://localhost/wordpress/wp-admin/setup-config.php, after entering the requested information DB, User, Password, DB Host = localhost or mysql wampserver, the following page says that there is an error in connecting to the DB.

    I’ve also tried manually modifying the www/wamp/wordpress/wp-config-sample.php file (re-naming it wp-config.php with the same information provided above and then loading localhost/wordpress/, the result, an error message informing me that it can not connect to the database.

    Any ideas? I’m not an ubber server/db guy either. In fact, this project is part of my first install of those tools too. But I just giving some background here so the community doesn’t blow me away with tech-speak.

    Thanks everyone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do you get this as wp-admin login as well or just visiting the site?

    In wp-config.php double check and make sure everything is correct

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

    Most hosts use localhost but it can be different depending on what host you use. In some cases set Ip number.
    define('DB_HOST', '192.168.1.1:8889');
    Your servers Ip.

    Some cases it can be permissions.
    creata a file called testconnection.php
    Put this code in it (change to your setting offcourse)

    <?php
    	$link = mysql_connect('localhost', 'root', 'password');
    	if (!$link) {
    	die('Could not connect: ' . mysql_error());
    	}
    echo 'Connected successfully';
    mysql_close($link);
    ?>

    If this one works go back and check your wp-config for typos

    Just realized that you on WAMP and local, Sorry about that.
    Maby something in my post can help you anyway.
    if not try this section:
    Localhostinstalls

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress install – can't connect to DB’ is closed to new replies.