Applicable to:
- Plesk for Linux
Symptoms
Plesk does not update /etc/container/dbuser-map file for MySQL Governor automatically and it does not works properly. When it is added manually it works.
Cause
Integration of MySQL Governor with Plesk is not supported yet.
Resolution
Such feature has been requested on User Voice resource. Top ranked suggestion will be considered to be implemented in future Plesk releases.
As a workaround, it is possible to update
/etc/container/dbuser-map
mapping file using
Plesk Event Handlers
.
Here is an example how it can be performed:
- Connect to the server using SSH
-
Create a folder for helpers scripts that will be executed when database user created/renamed/deleted via Plesk:
# mkdir /root/helpers/
-
Download tarball with examples of such scripts in the attachments, extract it and set correct permissions:
# wget -P /root/helpers https://support.plesk.com/hc/en-us/article_attachments/115005042134/governor_helpers.zip
# unzip /root/helpers/governor_helpers.zip -d /root/helpers/
# chmod 0750 /root/helpers/governor_dbu_*.sh
-
After that create corresponding event handlers:
# plesk bin event_handler --list-events | grep "Database user"
79 Database user account created
80 Database user account settings updated
81 Database user account removed# plesk bin event_handler --create -command /root/helpers/governor_dbu_create.sh -priority 50 -user root -event 79
# plesk bin event_handler --create -command /root/helpers/governor_dbu_update.sh -priority 50 -user root -event 80
# plesk bin event_handler --create -command /root/helpers/governor_dbu_delete.sh -priority 50 -user root -event 81 -
Check that Event Handler have been added in Plesk UI
Note: Such scripts are examples and do not have error exceptions check or any kind of verification for /etc/container/dbuser-map file integrity. It is just an examples that can be improved.
Comments
0 comments
Please sign in to leave a comment.