Title: Yet another &#8220;Cannot select database&#8221; problem
Last modified: May 27, 2024

---

# Yet another “Cannot select database” problem

 *  [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/)
 * (@wordpresskuma)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/)
 * Like the countless other posts here and around the web, I’ve run into the **Cannot
   select database** wall.
 * I’m doing a local install using **XAMPP**.
    - Apache is running
    - MySQL is running
    - The database wordpress has been created
    - Username **root** on **localhost** has ALL PRIVILEGES
    - There is a **wp-config-sample.php** file in the wordpress folder
 * My specific error is this:
 * > **Cannot select database**
   > The database server could be connected to (which means your username and password
   > is okay) but the database could not be selected.
   >  - Are you sure it exists?
   >  - Does the user `root` have permission to use the database?
   >  - On some systems the name of your database is prefixed with your username,
   >    so it would be like `username_`. Could that be the problem?
 * To answer these 3 points:
    - The database exists
    - The user root has ALL PRIVILEGES
    - The database has no prefix. It’s “wordpress”
 * I’ve read countless posts about this problem, none of the suggestions have worked.
   And a lot of them suggested renaming the **wp-config-sample.php** file to **wp-
   config.php** and entering my credentials, but the installer REQUIRES the sample
   file, not the completed file.
 * This is my first local install and I’m a db noob, so any help is greatly appreciated!

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

 *  [Abdul Hannan](https://wordpress.org/support/users/ksthannan/)
 * (@ksthannan)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-17783988)
 * Hi WordPresskuma, 
   1. Are you able to manage using this link [http://localhost/phpmyadmin/](http://localhost/phpmyadmin/)?
   2. Are you able to visit website using [http://localhost/wpprojectname/](http://localhost/wpproject/)
   your project url? Delete wp-config.php file and install from browser visit using
   [http://localhost/wpprojectname/](http://localhost/wpproject/) url. Be confirm
   that you are providing **DB_NAME**, **DB_USER**, **DB_PASSWORD**, **DB_HOST **
   all the credentials correctly.Normally the credentials should be:‘wordpress’,‘
   root’, ‘ ‘, (empty)‘localhost’Please try properly, hope it will work. Best regards,
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-17784377)
 * Two more tips:
   Check with XAMPP whether the database is actually running.Also
   check the Windows firewall. This could also be blocking the connection.
 *  Thread Starter [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/)
 * (@wordpresskuma)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-17784714)
 * Thanks [@ksthannan](https://wordpress.org/support/users/ksthannan/) .
 * I _can_ access localhost/phpmyadmin and my project is simply localhost/wordpress
   at the moment as I can’t install WP.
 * However, as I noted above, there is no wp-config file to delete or edit because
   I don’t get past the setup.
 * I get to here: [http://localhost/wordpress/wp-admin/setup-config.php](http://localhost/wordpress/wp-admin/setup-config.php),
   then choose my language, then I get to [setup-config.php?step=1](http://localhost/wordpress/wp-admin/setup-config.php?step=1)
   and enter my info. Then I get the error page.
 * The wp-config is still the wp-config-sample file. If I remove/rename it, I get
   an error during the installation that it is missing. 🤷‍♂️
    -  This reply was modified 1 year, 12 months ago by [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/).
 *  Thread Starter [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/)
 * (@wordpresskuma)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-17784725)
 * Thanks [@threadi](https://wordpress.org/support/users/threadi/).
 * The MySQL **Module** is running (Port 3307). However, the **Service** checkbox
   has a red X in it. Do I want that to be a green checkmark?
 * Also, I looked at my firewall settings and **mysqld.exe** is allowed through.(
   There are no XAMPP files listed in the firewall settings.)
 *  Thread Starter [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/)
 * (@wordpresskuma)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-17784833)
 * [@threadi](https://wordpress.org/support/users/threadi/) actually, I rebooted
   XAMPP and there are no red X’s under **Service** now. Under **Module** both Apache
   and MySQL are green and running.
 *  Thread Starter [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/)
 * (@wordpresskuma)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-17784911)
 * Problem solved. I decided to read the **readme.html** doc in /wordpress. (What
   a concept!🤦‍♂️)
 * And it says:
 * >  1. Open [wp-admin/install.php](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/wp-admin/install.php?output_format=md)
   >     in your browser. It will take you through the process to set up a `wp-config.
   >     php` file with your database connection details.
   >  2.  a. **If for some reason this does not work, do not worry. It may not work on
   >         all web hosts. **Open up `wp-config-sample.php` with a text editor like WordPad
   >         or similar and fill in your database connection details.
   >      b. Save the file as `wp-config.php` and upload it.
   >      c. Open [wp-admin/install.php](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/wp-admin/install.php?output_format=md)
   >         in your browser.
 * The solution was as Abdul suggested, except that it can’t run from the installer
   page as that requires the **wp-config-sample.php** file. You need to go to **
   wordpress/wp-admin/install.php** (rather than localhost/wordpress) in the browser.
   Then it goes straight to setup page for site name, etc.
 * Thanks [@ksthannan](https://wordpress.org/support/users/ksthannan/) and [@threadi](https://wordpress.org/support/users/threadi/)
   for your time.
    -  This reply was modified 1 year, 12 months ago by [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/).
    -  This reply was modified 1 year, 12 months ago by [wordpresskuma](https://wordpress.org/support/users/wordpresskuma/).
 *  [Armand Thierry](https://wordpress.org/support/users/leppidjapress1/)
 * (@leppidjapress1)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-18076091)
 * @[wordpresskuma](https://wordpress.org/support/users/wordpresskuma/)  
   I followed
   your instructions and it worked.

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

The topic ‘Yet another “Cannot select database” problem’ is closed to new replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 8 replies
 * 7 participants
 * Last reply from: [Armand Thierry](https://wordpress.org/support/users/leppidjapress1/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/yet-another-cannot-select-database-problem/#post-18076091)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
