• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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