Service type
MariaDB service
Self-hosted MariaDB database service for applications that keep relational data inside the stack.
You add this service to a stack, where you choose its version and resources. Each app environment can override them.
On Wodby
How MariaDB runs on Wodby
Database, user and passwords
Wodby manages the database and its user; the application does not create them.
- One database and one user are created for the environment, both named after the application and the environment. The user is granted all privileges on that database only.
- The database is created with the charset and collation chosen for it on Wodby (
utf8mb4by default). - The user's password and the
rootpassword are generated once per environment (tokenspasswordandroot_password). The container has the root password inMYSQL_ROOT_PASSWORD. - Further databases and users are added on Wodby, which runs the same create and grant actions. A user created by hand with a name Wodby later needs, but another password, makes the create action fail rather than replace it.
How a linked service reaches it
- Host: the name of this app service inside the environment. Port:
3306. - A service linked to this one receives the host, port, database name, user name and password as environment variables defined by its own link (for example
DB_HOST,DB_PORT,DB_NAME,DB_USERNAME,DB_PASSWORDon the PHP service). Read those in the application; do not hardcode them and do not userootfrom the application.
Server configuration
The container writes /etc/mysql/my.cnf on every start from environment variables. Change a setting by setting the variable on this service, not by editing the file. The ones used most:
MYSQL_INNODB_BUFFER_POOL_SIZE,MYSQL_MAX_CONNECTIONS,MYSQL_MAX_ALLOWED_PACKETMYSQL_CHARACTER_SET_SERVER,MYSQL_COLLATION_SERVERMYSQL_WAIT_TIMEOUT,MYSQL_INNODB_LOCK_WAIT_TIMEOUT,MYSQL_TRANSACTION_ISOLATIONMYSQL_SLOW_QUERY_LOG,MYSQL_LONG_QUERY_TIME,MYSQL_GENERAL_LOG
A change applies with the next deployment of the service. Host names are not resolved (skip-name-resolve), and the client character set handshake is skipped: connections use the server character set.
Data, backups and imports
- Data is on the
datavolume, mounted at/var/lib/mysql. - The backup is a gzipped SQL dump of the environment's database made with
mariadb-dump --single-transaction. Tables listed in its "excluded table contents" option (names orLIKEpatterns) keep their definition and lose their rows. - The database import replaces the data volume: the dump is loaded while a new, empty data directory is initialized. It accepts
.gz,.tar.gz,.tgzand.zipholding exactly one.sqlor.mysqlfile. - After a version upgrade Wodby runs
mariadb-upgradeandmariadb-checkon the environment's database and on themysqlsystem database.
Check the result
In the database container:
mariadb -uroot -p"$MYSQL_ROOT_PASSWORD" -e 'SHOW DATABASES;'lists the databases.mariadb -uroot -p"$MYSQL_ROOT_PASSWORD" -e "SHOW VARIABLES LIKE 'max_connections';"shows a setting as the server runs it.
Overview
Technical profile of MariaDB
Versions
Source repository
Public Helm chart
Persistent volumes
Database page
Stacks
Stacks that include MariaDB
Data
Backups and data import for MariaDB
Manual and scheduled backups
Run a backup when you need one, or set a schedule in a backup preset.
Import from an archive, a URL, or a backup
An import takes an uploaded archive, a public URL, or a completed backup of a compatible service.
Where archives are stored
Wodby writes each archive to Wodby Blob Storage or to a bucket at a storage provider that you connect as an integration.
Configuration
MariaDB service configuration
Volumes
Actions
Related databases