Drupal 6 share tables across two databases with two different users

Hey guys, 

I can’t get my head around this. Maybe someone can give me a suggestion. 

I have two Drupal 6 instances in two different folders. Each is using its own DB. All i want is to share some tables from the first to the second. 
I managed to do that by doing this in settings.php : 

 

$db_url = 'mysqli://db2user:[email protected]/db2_db';

$db_prefix = array(
    'default'   => '',
    'authmap' => 'db1_db.',
    'profile_fields' => 'db1_db.',
    'profile_values' => 'db1_db.',
    'role' => 'db1_db.',
    'sessions' => 'db1_db.',
    'users' => 'db1_db.',
    ................
);

This works because the db2user has access to both databases. 

What I want to do is move the websites in a production environment, each website with it’s Cpanel account. 

I did that but I can’t have the same DB user across two Cpanel accounts.

So, is there a way to specify the credentials for each DB then use the connection to specify which tables to share? 

I tried this but it didn’t work: 

$db_url['default'] = 'mysqli://db1user:[email protected]/db1_db';
$db_url['second'] = 'mysqli://db2user:[email protected]/db2_db';



$db_prefix = array(
    'default'   => '',
    'authmap' => 'second.',
    'profile_fields' => 'second.',
    'profile_values' => 'second.',
    'role' => 'second.',
    'sessions' => 'second.',
    'users' => 'second.',
    ................
);

Any idea would be really appreciated. Thanks. 

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed