• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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