• Resolved n2fole00

    (@n2fole00)


    Hi, I’m trying to migrate a wp site to another host. After the transfer, I turned debug on, I got this message.

    Can’t select database
    We were able to connect to the database server (which means your username and password is okay) but not able to select the leke_wordpress database.

    Are you sure it exists?
    Does the user b5_23911346 have permission to use the leke_wordpress database?
    On some systems the name of your database is prefixed with your username, so it would be like username_leke_wordpress. Could that be the problem?

    Here is how I migrated the site.

    1. I made a backup of the wp root folder and transferred that to the same directory structure in the new host.
    2. I exported the wp database.
    3. I changed the database name instances in the sql export file to the new host’s database name.
    4. I imported the database to the new host.
    5. I updated the wp-config to reflect changes in the new database.

    Here are my files and settings. Let me know if you see anything wrong.

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'leke_wordpress');
    
    /** MySQL database username */
    define('DB_USER', 'b5_23911346'); // i changed this
    
    /** MySQL database password */
    define('DB_PASSWORD', '**********'); // i changed this
    
    /** MySQL hostname */
    define('DB_HOST', 'sql203.byethost.com'); // i changed this from localhost
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8mb4');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each
     * a unique prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'b5_23911346_';  // i changed this from home_
    

    Database table rows https://imgur.com/ofup2oa

    Database registration https://imgur.com/42ThItv

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • In your wp-config.php file change
    define('DB_NAME', 'leke_wordpress');

    to
    define('DB_NAME', 'b5_23911346_leke_wordpress');

    Hope this helps. Once you have fixed the issue please tag the thread resolved.

    Thread Starter n2fole00

    (@n2fole00)

    Thanks, Davood. It was indeed that.

    MY pleasure. Happy to help whenever and wherever I can! 🙂

    Happy Blogging!

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

The topic ‘Not able to select the database error; after migrate’ is closed to new replies.