/go/mariadbquota stops one database user from using all of the server's database capacity. It reads three limits from GoAdmio's settings and applies them to every MariaDB user on the server, except system accounts: When it finishes, it runs my, which regenerates the MariaDB configuration and restarts MariaDB. Expect a short database interruption every time you run this command. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Apply the saved limits to all database users
/go/mariadbquota
Options
This command has no options. The limits come from GoAdmio’s settings database, not from the command line.
| Stored value | Applied to each user as | What it limits |
|---|---|---|
MAX_USER_CONNECTIONS |
MAX_USER_CONNECTIONS |
Simultaneous connections |
MAX_QUESTIONS |
MAX_QUERIES_PER_HOUR |
Statements per hour |
MAX_UPDATES |
MAX_UPDATES_PER_HOUR |
Statements that change data, per hour |
The values are read from row 1 of the MariaDB table in /var/lib/sqlite/mariadb.db. A value of 0 means no limit. For connections, 0 means the server-wide max_user_connections setting applies.
The command skips these accounts: root, mysql, mariadb.sys, mysql.session, mysql.sys, and PUBLIC. Every other account is limited, including any extra accounts you created yourself (for example a monitoring or backup user).
Examples
# Apply the saved limits
/go/mariadbquota
# Show the limits that the command will apply
sudo sqlite3 /var/lib/sqlite/mariadb.db "select MAX_USER_CONNECTIONS, MAX_QUESTIONS, MAX_UPDATES from MariaDB where MariaDBID='1'"
# Check the limits that are now set on each user
sudo mariadb -e "SELECT user, host, max_user_connections, max_questions, max_updates FROM mysql.user"
Output
The command prints nothing when it works, so a quiet run is normal. Errors from MariaDB are printed as they happen, followed by anything my prints. The exit status is the one returned by my.
The run is recorded in /var/log/go/mariadbquota.log.
Security
[!WARNING]
The MariaDB root password is passed to themariadbclient on its command line, so it is briefly visible in the process list while the command runs.
See the full reference at /go/mariadbquota and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
