MySQL user without SHOW DATABASES privilege

I have to deploy on an environment where the MySQL user hasn’t SHOW DATABASES privilege.
The _lib folder was created with latest version of SC, 9.9.007 (4).
When I create the database connection, I specify host, port, username e password, I know the database name, but the combo that have to show the available databases is gray and do not show anything.
In the error log I saw

PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1227 Access denied; you need (at least one of) the SHOW DATABASES privilege(s) for this operation

I can save the connection but then every query fails because is not selected a database.

Please, SC, can you intercept this exception/errore and change the combo to edit box so I can manually write the database name ? I know it’s very rare case, but it’s my case for onw project.

Workaround 1

Insert in the OnScriptinit evet the code

sc_exec_sql("USE  dbname");

You have to pray that you have few apps, and the dbname is the same in production and development environemnt.

Workaround 2

Since the connections data are stored in the file prod.config.php in the conf folder, and data is a serialize of a php data structure once you have the database name encripted you can change the file inserting the database name and so avoid to insert the USE statement in every app.

Workaround 3

not tested

on the first app, let’s say Login, use workaround 1 so it’s possibile to validate the login.

Then use macro sc_connection_edit , so all apps used later the login page have the database name (actually all connection parameters) , so you gave to repeat the connection info in the login page, but at least you have to do it in one place only.