Each server runs one MySQL 8.4 server, listening only on the server itself. Every database belongs to a site, and a database can have several users, each with its own privileges.
Add a database
$ xenopanel db add shop --site example.com
$ xenopanel db list # databases, their sites and sizes, and the usersNew databases use utf8mb4.
Add its users
$ xenopanel db user add shop_app --database shop --privileges app
$ xenopanel db user add shop_deploy --database shop --privileges migrate
$ xenopanel db user add shop_report --database shop --privileges readEach user gets one preset per database:
- full: every privilege on the database
- app: reading and writing data, the usual choice for a site (the default)
- migrate: app, plus changing tables, indexes, views, triggers and routines
- read: reading only
- custom: the privileges you list, for example
custom:SELECT,INSERT
To give an existing user access to another database, run db user add again with that database. A user works from the server over both localhost and 127.0.0.1.
Passwords
XenoPanel generates each user’s password and keeps it in your Mac’s Keychain. It’s never written to a file on your Mac.
$ xenopanel db user password shop_app --show
$ xenopanel db user password shop_app --rotate # a new password, set on the server
$ xenopanel db user password shop_app --option-file --client acme--option-file writes ~/.xenopanel/shop_app.cnf into the client’s home, readable only by them, so command-line tools and cron jobs can log in without the password on the command line.
Removing databases and users
xenopanel db remove shopmakes XenoPanel forget the database; it stays in MySQL. Add--delete-datato drop it, which XenoPanel does only after a full dump into the run’s journal on the server, and reports where it is.xenopanel db user remove shop_appdrops the user. Its password stays in your Keychain unless you add--delete-secrets.
Before every database change, XenoPanel saves the statements that undo it in the run’s journal, so a step that fails its check is put back as it was.