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.