#Cube: mariadb
MariaDB 13 with its own data directory and socket. The server runs as the mysql operating-system account and the platform gets a superuser with the password from aegis.toml.
In the panel: Database → MariaDB. Every write there is a task.
#Configuration
[mariadb]port = 3306user = "mysql" # operating-system accountconfig_dir = "/aegis/config/mariadb"data_dir = "/aegis/data/mariadb"run_dir = "/aegis/run/mariadb"log_dir = "/aegis/logs/mariadb"max_connections = 200innodb_buffer_pool = "512M"| Key | Default | Meaning |
|---|---|---|
port | 3306 | TCP port on 127.0.0.1 |
user | mysql | system account the server runs as |
config_dir | /aegis/config/mariadb | aegis-my.cnf |
data_dir | /aegis/data/mariadb | datadir created by mariadb-install-db |
run_dir | /aegis/run/mariadb | socket and pid file |
log_dir | /aegis/logs/mariadb | error.log |
max_connections | 200 | server ceiling |
innodb_buffer_pool | 512M | InnoDB buffer pool size |
The platform role comes from [aegis] user / [aegis] password; configure creates it on both localhost and 127.0.0.1 with GRANT ALL … WITH GRANT OPTION.
#Files
<mariadb.config_dir>/└── aegis-my.cnf server configuration (0600)<mariadb.data_dir>/ data directory (mariadb-install-db)<mariadb.run_dir>/├── mysqld.sock└── mysqld.pid<mariadb.log_dir>/└── error.log#Commands
aegis cubes mariadb configure # data directory on first run, config, startaegis cubes mariadb validate # mariadb-admin ping over the socketaegis cubes mariadb reload # FLUSH PRIVILEGES + table cacheaegis cubes mariadb start|stop|restart|statusaegis cubes mariadb databases list|create|dropaegis cubes mariadb users list|add|remove|password|grant|revokeaegis cubes mariadb tables <db> list|check|repair|optimize|analyzeaegis cubes mariadb expose#Users
A user is created on both local hosts (localhost and 127.0.0.1), because MariaDB treats them as different accounts and the platform connects over TCP. Grants are per database; nothing is granted globally.
# generated password, printed onceaegis cubes mariadb users add shop --database shop_db# explicit password, granted on two databasesaegis cubes mariadb users add shop --password 'secret' --database shop_db --database shop_statsaegis cubes mariadb users grant shop shop_statsaegis cubes mariadb users revoke shop shop_statsaegis cubes mariadb users password shop --password 'new-secret'aegis cubes mariadb users remove shopusers list shows user@host pairs. add refuses a name that already exists; it never resets the password of an existing account (that is password).
#Tables and maintenance
aegis cubes mariadb tables shop_db listaegis cubes mariadb tables shop_db checkaegis cubes mariadb tables shop_db repairaegis cubes mariadb tables shop_db optimize orders invoicesaegis cubes mariadb tables shop_db analyze| Action | Statement | Use |
|---|---|---|
check | CHECK TABLE | reports errors without touching data |
repair | REPAIR TABLE | fixes crash damage (MyISAM; InnoDB reports "not supported") |
optimize | OPTIMIZE TABLE | rewrites the table, reclaims space |
analyze | ANALYZE TABLE | refreshes index statistics |
Without a table list, the action runs on every table of the database. A failure names the table and stops with the first ten problems.
#configure
mysql group and user when missing;aegis-my.cnf;mariadb-install-db when the data directory is empty —--auth-root-authentication-method=normal, --skip-test-db, with the rendered defaults file;
Where the bootstrap tool lives: mariadb-install-db is installed under scripts/, not bin/, so the cube searches bin, sbin and scripts.
#The platform role
[aegis] user / [aegis] password become a superuser on both local hosts (localhost and 127.0.0.1), because a client that resolves localhost to IPv6 would otherwise fail:
mariadb -h 127.0.0.1 -u aegis -proot over the socket has no password (--auth-root-authentication-method=normal), which is what the cube itself uses for administration.
#databases
Created databases get utf8mb4 / utf8mb4_unicode_ci and a GRANT ALL to the platform role for both local hosts.
#Process
[services.mariadb]command = <prefix>/bin/mariadbd --defaults-file=<config_dir>/aegis-my.cnfpid_file = <run_dir>/mysqld.piduser = mysql#expose
aegis cubes mariadb exposecube mariadbinstalled /aegis/apps/data/mariadb/13.0configuration /aegis/config/mariadbstate running pid 741852log /aegis/logs/mariadb/error.logconfig /aegis/config/mariadb/aegis-my.cnfdata /aegis/data/mariadbport 3306socket /aegis/run/mariadb/mysqld.sockpublished /aegis/bin/mariadb /aegis/bin/mariadb-admin #Notes
is disabled`); the cube reads only stdout, so results stay clean.
mariadb-admin ping is the validation step: it answers without credentialsbecause root uses socket authentication.
--skip-column-names --batch and is split on |.