Multiple WordPress sites with one shared DB using Docker Multiple WordPress sites with one shared DB using Docker wordpress wordpress

Multiple WordPress sites with one shared DB using Docker


Yes, you can install multiple WordPress instances into one database. You just need to change the database prefix for each install when installing. Just check your wp-config and change prefix and DBs credentials.

// ** MySQL settings - You can get this info from your web host ** ///** The name of the database for WordPress */define('DB_NAME', 'database_name_here');/** MySQL database username */define('DB_USER', 'username_here');/** MySQL database password */define('DB_PASSWORD', 'password_here');/** MySQL hostname */define('DB_HOST', 'localhost');/** Database Charset to use in creating database tables. */define('DB_CHARSET', 'utf8');/** The Database Collate type. Don't change this if in doubt. */define('DB_COLLATE', '');


Did you try setting up table prefix in wp_config.php

$table_prefix  = 'yourcustomname_';

This should resolve the issue with one DB connection on both sites..