Title: WordPress Error Can&#8217;t Select Database
Last modified: April 19, 2020

---

# WordPress Error Can’t Select Database

 *  [sandiegonotaryguy](https://wordpress.org/support/users/sandiegonotaryguy/)
 * (@sandiegonotaryguy)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-error-cant-select-database/)
 * Help! I downloaded Wamp Server on my portable local drive. Follwing directions
   in wpbegginer.com/wp-tutorials/how-to-install-wordpress=on-your-windows-computer_using-
   wamp64. I used Google Chrome as the browser. I followed the setting up a database
   for local wordpress setup instructions on the local host phpMyAdmin. When got
   to phpMyAdmin, the directions say to enter root as user name and leave password
   blank, and chose MySQl as server choice and clicked go. I logged in to the MySQL
   local server to create a database. Named it notary_db and chose Collation and
   created the blank database. I installed wordpress to a folder named WordPress
   and renamed it mylocalwordpresstestsite.I then opened the web browser and went
   to [http://localhost/mylocalwordpresstestsite](http://localhost/mylocalwordpresstestsite)/,
   chose English and clicked Lets’ Go! I entered database details: database name
   notary_db, chose root as user name, blanked out password, chose local host as
   database host, and wp_ as table prefix and clicked submit. At this point I got
   the message:
    Can’t select databaseWe were able to connect to the database server(
   which means your username and password is okay) but not able to select the notary_db
   database. Are you sure it exists? Does the user root have permission to use the
   notary_db database? On some systems the name of your database is prefixed with
   your username, so it would be like username_notary_db. Could that be the problem?
   How can I fix this issue since I followed the direction exactly? I have windows
   10 desktop pc 64 bit.
    -  This topic was modified 6 years, 1 month ago by [James Huff](https://wordpress.org/support/users/macmanx/).
      Reason: moved to Localhost Installs forum, since this is a localhost issue
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwordpress-error-cant-select-database%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * (@rossmitchell)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-error-cant-select-database/#post-12705206)
 * Welcome to the localhost world.
    My suspicion is that your root user does not
   have permissions on the database you created, these steps will help you check
   and fix this. – in your browser load phpmyadmin, login etc. – you will get a 
   display that list your databases in a column on the left, one of them should 
   be “information_schema”, and your “notary_db”, please confirm this. – click on“
   notary_db” and the tab: “Privileges”, it will list the databse users and their
   settings, in the “Privileges” column it should say “All Privileges” against “
   root”, use the “Edit Privileges” link to fix if necessary. please report what
   you see.
 * If the above does not help then check your server error logs, also suggest you
   then seek support from the”Wamp” community.
 *  Thread Starter [sandiegonotaryguy](https://wordpress.org/support/users/sandiegonotaryguy/)
 * (@sandiegonotaryguy)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-error-cant-select-database/#post-12711418)
 * Thank you Ross. I will check that out in the next couple of days and let you 
   know of the progress.
    Steve
 *  [jbdegarmo](https://wordpress.org/support/users/jbdegarmo/)
 * (@jbdegarmo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-error-cant-select-database/#post-12719706)
 * I’m having the same issue with MAMP on a Mac. I’ve checked PHYMyAdmin and the
   root user and the other user that I set up both have the correct “All Privileges”.
   I created a test.php script to test my DB credentials and the connection is successful.
   My issue is that the “no database selected” error displays after upgrading my
   PHP. If I select any version greater than PHP 7.1.32, I get the error. As soon
   as I switch it back, the website works. So, I don’t believe that this is a DB
   issue in my case.
 *  [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * (@rossmitchell)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-error-cant-select-database/#post-12730045)
 * Hello [@jbdegarmo](https://wordpress.org/support/users/jbdegarmo/)
    Welcome to
   the WordPress support forums. Please take the time to read the forum guidelines,
   it is very strongly required that people NOT drop into running threads with their
   own issues. Trust us it works better for everyone if you were to start a new 
   thread to ask your question, by all means read threads to see if they fix your
   problem, but if you need your own help, then start a new thread. It may not make
   much sense to you, but that is because you are new here. Among the reasons this
   is a rule is that many people like myself scan for and read threads that are 
   new, adding your question into a thread means that many fewer people will see
   it.
 * That aside, it does seem that you do not have a database problem, but rather 
   a PHP version related one. Suggest that you enable maximum debugging options 
   and look into the WordPress and server logs.
    In your file: ‘wp-config.php’ find
   the line with: `define( 'WP_DEBUG',` and comment it out and add:
 *     ```
           error_reporting(E_ALL); ini_set('display_errors', 1);
           define( 'WP_DEBUG', true);
       ```
   
 * Then see if you get any messages or logged errors.

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

The topic ‘WordPress Error Can’t Select Database’ is closed to new replies.

## Tags

 * [Can't select database](https://wordpress.org/support/topic-tag/cant-select-database/)
 * [database errors](https://wordpress.org/support/topic-tag/database-errors/)
 * [wordpress errors](https://wordpress.org/support/topic-tag/wordpress-errors/)

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 4 replies
 * 3 participants
 * Last reply from: [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-error-cant-select-database/#post-12730045)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
