I was given a task to create a Wordpress Multisite, and to make Wordpress Multisite create tables for each new site inside another database that is made just for that (new) site (let's assume that databases for each site don't have to be created and that they already exist).
I have successfully installed HyperDB and created WP Multisite however I'm still having trouble with the creation of new tables of the site inside the database meant just for the new site.
I managed for tables to be created inside the main database, i.e. for each new site there are specific tables in the main database such as wp_1_posts, wp_2_posts... Unfortunately, that is not the wanted result.
I've been struggling with this thing for quite some time. Anyone having experience with this?
I would be very grateful if someone knows how to do this.
Here is some code. I am not sure of how much it is helpful, but just in case:
$wpdb->add_database( array(
'host' => DB_HOST,
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => DB_NAME,
'write' => 1,
) );
$wpdb->add_database( array(
'host' => 'example.host.com',
'user' => 'user',
'password' => 'P455',
'name' => 'db_name',
'write' => 0,
'read' => 1,
) );