How to use a different db from the same server?

Created on 15 February 2023, over 1 year ago

Problem/Motivation

I use Advanced ban on more than 10 websites.
I want to make all websites use one db advban_ip table.
For example:

I want the Advanced ban module from idbip.com to use the advban_ip table from dosula.com's database.
Site1:dosula.com (database:dosula_com)
Site2:idbip.com (database:idbip_com)

Proposed resolution

I tried but failed by adding this to the idbip's settings PHP

$databases['default']['default'] = array (
  'database' => 'idbip_com',
  'username' => 'idbip_com',
  'password' => '111111111111111',
  'prefix' => array(
    'default' => '',
    'advban_ip' => 'dosula_com.',
  ),
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

$databases['dosula_com']['default'] = array (
  'database' => 'dosula_com',
  'username' => 'dosula_com',
  'password' => '888888888888',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

Any ideas?

πŸ’¬ Support request
Status

Active

Version

1.5

Component

Miscellaneous

Created by

πŸ‡·πŸ‡΄Romania idflorin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024