• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

CLI database server settings - access control - solved

Jens Johansson

Basic Pleskian
Hi there,

i would like to change the access control for datebase users via CL:
command: /usr/local/psa/bin/database --update-dbuser web1_presta -server localhost:3306
reply: The database user was successfully updated.
examination: mysql> select host, user from mysql.user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | web1_presta |
| localhost | web1_oxid |
| localhost | web1_presta |
| localhost | web1_shopware |
| localhost | web1_wp |
+-----------+------------------+

Only when using the GUI:
home -> Subscriptions -> Website & Domains -> Databases -> Users -> web1_wp -> Access control
-> from Allow remote connections from any host
-> to Allow local connections only

is also the user adjusted:
mysql> select host, user from mysql.user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | web1_oxid |
| localhost | web1_presta |
| localhost | web1_shopware |
| localhost | web1_wp |
+-----------+------------------+

Does anyone have an idea :)? Many Thanks!

Erik
 
damn, wrong command, correct is: /usr/local/psa/bin/database -u web1_wp -update_user web1_wp -set-acl localhost

Can anyone tell me how to change all users and all databases with one command?
 
much easier with "replace" ...

check:
mysql> select host, user, db from mysql.db;

+-----------+------------------+
| host | user |
+-----------+------------------+
| % | web1_wp |
| localhost | web1_oxid |
| localhost | web1_presta |
| localhost | web1_shopware |
+-----------+------------------+

+-----------+------------------+-------------------------+
| host | user | db |
+-----------+------------------+-------------------------+
| % | web1_wp | web1\_wp |
| localhost | web1_oxid | web1\_oxid |
| localhost | web1_presta | web1\_presta |
| localhost | web1_shopware | web1\_shopware |
+-----------+------------------+-------------------------+

set:
update db set host = replace(host,'%','localhost');
update user set host = replace(host,'%','localhost');

mysql> select host, user from mysql.user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | web1_oxid |
| localhost | web1_presta |
| localhost | web1_shopware |
| localhost | web1_wp |
+-----------+------------------+


mysql> select host, user, db from mysql.db;
+-----------+------------------+-------------------------+
| host | user | db |
+-----------+------------------+-------------------------+
| localhost | web1_oxid | web1\_oxid |
| localhost | web1_presta | web1\_presta |
| localhost | web1_shopware | web1\_shopware |
| localhost | web1_wp | web1\_wp |
+-----------+------------------+-------------------------+
 
Back
Top