Forums

[resolved] New config.php couldn't connect to database (3 posts)

  1. Jack Tummers
    Member
    Posted 3 years ago #

    When I compare my 'old' config.php with the new, I can only point out these differences at the end of the file...

    My old config.php:

    /* That's all, stop editing! Happy blogging. */
    
    define('WP_POST_REVISIONS', false);
    
    define('ABSPATH', dirname(__FILE__).'/');
    
    require_once(ABSPATH.'wp-settings.php');
    
    ?>

    The new one from 2.7:

    /* That's all, stop editing! Happy blogging. */
    
    /** WordPress 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');
    
    ?>

    Somehow WP gave me the message when trying to upgrade, that my username and password were ok, but that it could not find/connect the database and asked me of I had permission to do so.

    Why isn't the new config.php not working for me? The rest of the content is the same.

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    A database connection error usually means something is wrong with one or more of the DB_NAME, DB_USER, DB_PASSWORD, DB_HOST values in wp-config.php or the database server is down.

  3. Jack Tummers
    Member
    Posted 3 years ago #

    Ah, stupid... my fault.
    I copied everything but left one line above the db information:

    /** The name of the database for WordPress */
    
    define('DB_NAME', 'putyourdbnamehere');

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic