• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question How to use Plesk CLI to change 'Default settings for remote access of database users'?

Visnet

Basic Pleskian
We would like to change the option "Default settings for remote access of database users" ('Tools & Settings' > 'Database Hosting Preferences') to "Allow local connections only", using Plesk CLI.

The following commands do not seem to be the solution:
Code:
plesk bin server_pref -allow-siteapp-local-db false
or
Code:
# plesk bin server_pref -allow-siteapp-local-db false
Unknown command: -allow-siteapp-local-db

exit status 1

How can this be done using the Plesk CLI?

Using Plesk 12.5.30 MU #71
 
Looks like there is bug in Documentation server_pref: Interface and System Preferences regarding -allow-siteapp-local-db option. I have submitted it as PDP-70. Thanks.

You can this option to "Allow local connections only" in CLI with following command:

Code:
# plesk db "update misc set val='localhost' where param='default_database_acl_hosts'"
 
The query you posted doesn't have any effect that gets reflected in the web interface.

Also the 'default_database_acl_hosts' param doesn't seem to be present in the database, also not after executing the query you posted.
Code:
MariaDB [psa]> select * from misc where param='default_database_acl_hosts';
Empty set (0.00 sec)

Please advise..
 
This option doesn't exists by default in misc table of Plesk 12.5 database. Try to switch this option in Plesk UI and this option will appear in misc. Or create it with SQL command.
 
So the final query/command is:
Bash:
plesk db "INSERT INTO misc VALUES ('default_database_acl_hosts', 'localhost') ON DUPLICATE KEY UPDATE val='localhost'"
 
Back
Top