Title: Database Cache accessing incorrect database
Last modified: July 31, 2018

---

# Database Cache accessing incorrect database

 *  [MakeAnImpact](https://wordpress.org/support/users/refinedimpact/)
 * (@refinedimpact)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/database-cache-accessing-incorrect-database/)
 * Ran into an issue where information saved on one site was showing up on another.
   It was extremely weird, but if I disabled the W3 Total Cache plugin everything
   worked fine.
 * After further investigation, here were the issues/environment:
 * – Cloud Dedicated Server (Linux, Apache, PHP-FPM)
    – Using Memcache – Database
   Cache enabled (using Memcache) – Sites affected were installed in different directories
   on the same domain & cPanel account – Even if we migrated the sites to their 
   own domains and cPanel accounts, we still experienced the issue – Single WP installs,
   not multisite – The onset of these issues was intermittent, and didn’t occur 
   on all sites at any specific interval, but once it started the only way to fix
   was to disable W3 Total Cache. – .htaccess was getting modified with incorrect
   site redirect info – Logging into one site would redirect you to a different 
   site, logged in, even if your credentials weren’t for that site.
 * I assume it has something to do with memcache, and somehow the plugin is looking
   to the wrong database for information. It just seems like this shouldn’t happen
   under any circumstances, but it did.

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

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/database-cache-accessing-incorrect-database/#post-10547656)
 * Hello,
 * For the time being, the domain must be used with the separate key. At this moment
   it is not possible to use the same memcached server for multiple websites belonging
   to the same domain.
 *  [Greg Marshall](https://wordpress.org/support/users/timeassistant/)
 * (@timeassistant)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/database-cache-accessing-incorrect-database/#post-10555490)
 * Swap out Memcache with Redis, redis lets you define how many Redis DB’s you want
   and W3TC lets you choose which Redis database to connect it to.
 * It works similarly to memcache and can be installed via YUM if you have root 
   access. Redis docs are pretty good and its fairly easy to manage once you have
   a quick read.
 * Ypu can also set a max amount of RAM for Redis and configure key evictions to
   free up space when the memory runs out
 *  Thread Starter [MakeAnImpact](https://wordpress.org/support/users/refinedimpact/)
 * (@refinedimpact)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/database-cache-accessing-incorrect-database/#post-10564182)
 * Hi Marco. That’s interesting. There was no way for us to know that we would run
   into that issue until it happened. It might be an idea to note this on the settings
   page.
    Even after the sites were migrated from subdirectories to their own domains
   they still had the same issue.
 * Is this only an issue with database caching using memcache, or are you saying
   that we shouldn’t use memcache at all for sites on the same domain?
 *  [bgdstr](https://wordpress.org/support/users/bogdanstratulat/)
 * (@bogdanstratulat)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/database-cache-accessing-incorrect-database/#post-10565733)
 * You can use Memcache for everything else without any issues. Once again, I am
   sorry and if there is anything else, please feel free to ask.

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

The topic ‘Database Cache accessing incorrect database’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

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

 * 4 replies
 * 4 participants
 * Last reply from: [bgdstr](https://wordpress.org/support/users/bogdanstratulat/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/database-cache-accessing-incorrect-database/#post-10565733)
 * Status: not resolved