can't connect to database (4 posts)

  1. debragrant
    Posted 7 years ago #

    I am tranfering my sites to a new host and I have gallery & wordpress on the same database for each sumdomain.

    For one site everything is fine (I think) with the same username for both gallery & coppermine but for another I can't get a connection with wordpress. I've tried a different username but it still doesn't work.

    Could I have the config file wrong or something?

    // ** MySQL settings ** //
    define('DB_NAME', 'divahos_wrdp6');    // The name of the database
    define('DB_USER', 'divahos_admin');     // Your MySQL username
    define('DB_PASSWORD', 'xxxxxx'); // ...and password
    define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
    // Change each KEY to a different unique phrase.  You won't have to remember the phrases later,
    // so make them long and complicated.  You can visit http://api.wordpress.org/secret-key/1.1/
    // to get keys generated for you, or just make something up.  Each key should have a different phrase.
    define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
    define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
    define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
    // Change this to localize WordPress.  A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');
    /* That's all, stop editing! Happy blogging. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    require_once(ABSPATH . 'wp-settings.php');
  2. MichaelH
    Posted 7 years ago #

    If you have nothing in the database, try deleting the database, then recreate the database and assign/create a user with all privileges.

  3. kelly1234
    Posted 7 years ago #

    I tried a similar thing, I realize the post is old, but I can't connect to my database either. I restored, made a user for the restored database, changed the db name and password in the config file, still get message, "can't connect to database"

  4. jonradio
    Posted 7 years ago #

    Did you connect the user ID to the database with full permissions? That is a requirement.

    It is done with the same tool you used to create the user ID. Typically, cPanel.

Topic Closed

This topic has been closed to new replies.

About this Topic