• Hi, I’ve had a wordpress blog running for a while with no problems.

    Today I created a second blog in a different directory. It’s working now, but when I try to go the previous blog, I get the error:

    Error establishing a database connection

    Each blog has its own MySQL database. The settings for the first one are:
    define(‘DB_NAME’, ‘cybergoo_wrdprs’); // The name of the database
    define(‘DB_USER’, ‘cybergoo_gooch’); // Your MySQL username
    define(‘DB_PASSWORD’, ‘xxx’); // …and password
    define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    and the settings for the new one are:

    define(‘DB_NAME’, ‘cybergoo_cyberblog’);
    define(‘DB_USER’, ‘cybergoo_gooch’);
    define(‘DB_PASSWORD’, ‘yyy’);
    define(‘DB_HOST’, ‘localhost’);

    Am I creating a conflict by using localhost for both? Is there a specific path I should use for the host?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m running 2 installs of WP on localhost without any problem.

    Yes, you can run as many copies on localhost as you want. That error means there is about a 99.99% change that one (or more) of those values in your wp-config.php file is wrong.

    Just looking at your sample above, if you are using the same user for the second db, then you should be using the same password…the only difference would be the db_name.

    See the following video for more information on troubleshooting this error.

    https://educhalk.org/blog/?p=148

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can 2 blogs use localhost?’ is closed to new replies.