On 18/11/2022 08:45, Ibrahemoo Ghost wrote:
I could not share the connection pool across sql instances because it shared a single connection to a single database, What I want is to have each sql instance connect to a different database (Under the same mysql server).
If the databases are all on the same MySQL server, then you could simply ensure that the user you are connecting to the server as has appropriate permissions for all the databases and the amend your queries to prefix the table name with <databasename>. - MySQL allows queries to cross databases on the same host. E.g. SELECT id, username, attribute, value, op FROM db1.radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id you could even make the database name a dynamic expansion SELECT id, username, attribute, value, op FROM %{control:Local-Database}.radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id where Local-Database is an attribute you define in your local dictionary and populate in your policy before calling the SQL module. -- Nick Porter