Title: salt should include database
Last modified: August 30, 2016

---

# salt should include database

 *  Resolved [Scott Farrell](https://wordpress.org/support/users/sfarrell5123/)
 * (@sfarrell5123)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/salt-should-include-database/)
 * it seems your logic uses $table_prefix if its enabled.
 * So you understand, there can me multiple wp installs on one server. but, by the
   same logic, you should also index off the database name. so perhaps $db_name_
   $table_prefix – know it makes the key longer, but it is far safer.
 * as if 2 wp installs, have the same table_prefix, but a different db, they will
   clash. The default for table_prefix is wp_ , and I have several clients that 
   use table_prefix wp_ but a different db.
 * I can manually add the salt via wp-config.php – I know that – but its error prone.
 * It makes no logical sense to use table_prefix in isolation to dbname
 * perhaps though, I am wrong, and you have another method if there are multiple
   installs, seperate mysql databases. Like on a cpanel server.
 * [https://wordpress.org/plugins/redis-cache/](https://wordpress.org/plugins/redis-cache/)

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

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/salt-should-include-database/#post-6717773)
 * Mhhh, I get your point.
 * For standard setups I recommend using a separate Redis database for each WordPress
   installation. Why would they conflict exactly?
 *  Thread Starter [Scott Farrell](https://wordpress.org/support/users/sfarrell5123/)
 * (@sfarrell5123)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/salt-should-include-database/#post-6717797)
 * if they are in different redis databases, that should be fine. But you need to
   set that manually, per wp install.
 * if you have dozens/hundreds of wp installs, managing anything by hand – is too
   easy to break. If some thing wrong, and 2 installs end up talking to the same
   object cache, I’d assume they both get smashed, and need to recover the mysql
   database from backup.
 * what is the downside of my idea – just adding the database name into the salt–
   along with the table_prefix ? it’s the smallest amount of code, safe, fast – 
   only downside is a slightly larger key.
 * do you have another idea ? that isnt manual , that scales to hundres/thousands
   of wp installs ?
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/salt-should-include-database/#post-6717805)
 * Someone had requested this feature before, with the same argument, but the PR
   was rejected.
 * IMO object caching should be setup on a per site basis, when it’s needed, and
   installations should not share databases.
 * I’d recommend you add some kind of automated script to your hosting environment
   to configure new installations properly.

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

The topic ‘salt should include database’ is closed to new replies.

 * ![](https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513)
 * [Redis Object Cache](https://wordpress.org/plugins/redis-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/redis-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/redis-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redis-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redis-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/salt-should-include-database/#post-6717805)
 * Status: resolved