Title: Can’t select database
Last modified: August 18, 2016

---

# Can’t select database

 *  [godfly](https://wordpress.org/support/users/godfly/)
 * (@godfly)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/cant-select-database-4/)
 * I’m a newbie trying to install wordpress. It was running fine in my laptop (localhost
   via XAMPP) and so I decided to upload it on my server to do some further testing.
   I created the “blog” database and “wordpress” user, configured the wp-config.
   php < define(‘DB_NAME’, ‘blog’); define(‘DB_USER’, ‘wordpress’); > however, when
   I tried to access the site ( [http://www.alipin.com](http://www.alipin.com) )
   The following error below came up. Did I do something wrong or is there a latency
   period after creating the database?
 * 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 blog database.
 *  * Are you sure it exists?
    * On some systems the name of your database is prefixed
   with your username, so it would be like username_wordpress. Could that be the
   problem?
 * If you don’t know how to setup a database you should contact your host. If all
   else fails you may find help at the WordPress Support Forums.

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

 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/cant-select-database-4/#post-351748)
 * No latency, no. Did you make sure that “wordpress” user has access to the “blog”
   db?
 * Just in case: [http://codex.wordpress.org/Installing_WordPress](http://codex.wordpress.org/Installing_WordPress)
 *  Thread Starter [godfly](https://wordpress.org/support/users/godfly/)
 * (@godfly)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/cant-select-database-4/#post-351767)
 * Thanks for the reply HandySolo, yes I’m pretty sure “wordpress” has access to“
   blog”
 * Users in blog
    taobuhid_wordpre (Privileges: ALL PRIVILEGES)
 *  Connection Strings
    Perl $dbh = DBI->connect(“DBI:mysql:taobuhid_blog:localhost”,”
   taobuhid_wordpre”,”<PASSWORD HERE>”); PHP $dbh=mysql_connect (“localhost”, “taobuhid_wordpre”,“
   <PASSWORD HERE>”) or die (‘I cannot connect to the database because: ‘ . mysql_error());
   mysql_select_db (“taobuhid_blog”);

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

The topic ‘Can’t select database’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [select](https://wordpress.org/support/topic-tag/select/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 2 replies
 * 2 participants
 * Last reply from: [godfly](https://wordpress.org/support/users/godfly/)
 * Last activity: [20 years, 3 months ago](https://wordpress.org/support/topic/cant-select-database-4/#post-351767)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
