Title: Database error for existing site
Last modified: August 20, 2016

---

# Database error for existing site

 *  Resolved [courtneycj](https://wordpress.org/support/users/courtneycj/)
 * (@courtneycj)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/database-error-for-existing-site/)
 * Hello,
    I just got done upgrading my site to the latest version of php. Whereas
   I couldn’t log in to my dashboard at all before, I’m now getting the following
   error 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 [mydatabase]
   database.
 * Are you sure it exists?
    Does the user [mydatabase] have permission to use the[
   mydatabase] database? On some systems the name of your database is prefixed with
   your username, so it would be like username_[mydatabase]. Could that be the problem?”
 * I inserted all of the information as I had done so before on my old site and 
   exactly as it’s listed in 1&1. I don’t think this is a problem with the host.
   Can anyone offer me any advice as to how to fix this? Thank you very much!

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

 *  [Sugar Apple](https://wordpress.org/support/users/blacklizt/)
 * (@blacklizt)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/database-error-for-existing-site/#post-2245219)
 * take a look at
 * > On some systems the name of your database is prefixed with your username, so
   > it would be like username_[mydatabase].
 * for example, you are using Cpanel webhosting with username **courtneycj** and
   you make a database name **wordpress**
 * so, you need to edit your **wp-config.php**
    `define('DB_NAME', 'courtneycj_wordpress');`
 * i hope it works, my host like this
 *  Thread Starter [courtneycj](https://wordpress.org/support/users/courtneycj/)
 * (@courtneycj)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/database-error-for-existing-site/#post-2245220)
 * I fixed the problem — the username was actually the problem, but I fixed it. 
   Thanks for your suggestion!
 *  [Sugar Apple](https://wordpress.org/support/users/blacklizt/)
 * (@blacklizt)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/database-error-for-existing-site/#post-2245222)
 * you’re welcome

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

The topic ‘Database error for existing site’ is closed to new replies.

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)
 * [mysql database error](https://wordpress.org/support/topic-tag/mysql-database-error/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 3 replies
 * 2 participants
 * Last reply from: [Sugar Apple](https://wordpress.org/support/users/blacklizt/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/database-error-for-existing-site/#post-2245222)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
