Not able to select the database error; after migrate
-
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.
- I made a backup of the wp root folder and transferred that to the same directory structure in the new host.
- I exported the wp database.
- I changed the database name instances in the sql export file to the new host’s database name.
- I imported the database to the new host.
- 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.
The topic ‘Not able to select the database error; after migrate’ is closed to new replies.