Title: &#8220;Can&#8217;t select database&#8221; error after optimizing
Last modified: March 15, 2022

---

# “Can’t select database” error after optimizing

 *  Resolved [PauluaP](https://wordpress.org/support/users/pauluap/)
 * (@pauluap)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/cant-select-database-error-after-optimizing/)
 * After running the optimizations, one of my websites isn’t working and I get an
   error “Can’t select database” when going to the site.
 * This plugin and optimization was run from a different website, but which is connected
   to the same shared hosting package as my other website (eg both subdomains of
   another website (web1.xxxxx.com and web2.xxxxx.com as far as the hosting is concerned),
   if that matters. Perhaps it thought databases were unused because that particular
   website url didn’t use them, but another one does? (the one which doesn’t work
   now) — and it deleted needed databases for the other website?
 * The complete error reads:
 * > Can’t select database
   >  Are you sure it exists? Does the user xxxxxxxx have 
   > permission to use the xxxxxxxxx database? On some systems the name of your 
   > database is prefixed with your username, so it would be like username_xxxxxxxxxx.
   > Could that be the problem?
 * Can I get the deleted information back?

Viewing 1 replies (of 1 total)

 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/cant-select-database-error-after-optimizing/#post-15464091)
 * [@pauluap](https://wordpress.org/support/users/pauluap/) Sorry once the information
   is deleted it cannot be recovered.
 * Could you please check if your MySQL server is up and running, Also please check
   if the database user has all the privileges and assigned to the database?

Viewing 1 replies (of 1 total)

The topic ‘“Can’t select database” error after optimizing’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Harshad](https://wordpress.org/support/users/bornforphp/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/cant-select-database-error-after-optimizing/#post-15464091)
 * Status: resolved