Site icon Hip-Hop Website Design and Development

WordPress fails to install with "Can’t Select Database" Error (WAMPServer)

UPDATE: 2020-07-12 I tried installing on Windows 10 64-bit and it failed to install WordPress with the same database error as on Windows 7. That tells me that either there is a bug in WAMPServer 3.2.0 or there is a bug in WordPress 5.4.2. because the issue occurs on both operating systems.


ISSUE

I’m installing WordPress on WAMP as a local development server, WordPress fails to install, so no config file is created.

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 wp_ehw_20200627 database.

Are you sure it exists?

Does the user root have permission to use the wp_ehw_20200627 database?
On some systems the name of your database is prefixed with your username, so it would be like username_wp_ehw_20200627. Could that be the problem?

If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

MY SYSTEM DETAILS

HERE IS WHAT I KNOW

NOTE: I asked a similar question about a year ago, but this one is significantly different in that with the previous question WordPress was already installed, wheres in this scenario it is not.

THINGS I TRIED ALREADY

Suspecting that there might be issues with the naming of the database, I tried creating various empty databases for the install with different names. Success here is measured by whether or not the config.php file was created. Here are some of the names and results I tried:

By using the db I created named "test", for the first time I got this SUCCESS message:

"All right, sparky! You’ve made it through this part of the
installation. WordPress can now communicate with your database. If you
are ready, time now to…

Run the installation"

This result was encouraging, but that wasn’t the database name I wanted. Suspect the issue was the length of the database name (in characters), I continued testing with differnt names, getting smaller in size each time.

Finally, since "test" was the only name that worked so far, I picked another easy four-letter word to test if four was the magic number.

WEIRD ….

I also cleared Chrome cache in between each install attempt. I deleted the config file after success.

RESULTS

Only "test" created the config file.

I am very confused by these results.

Any help is appreciated.