Тип сервиса
Сервис MariaDB
Самостоятельно размещаемый сервис базы данных MariaDB для приложений, которые хранят реляционные данные внутри стека.
Вы добавляете этот сервис в стек и выбираете там его версию и ресурсы. Каждое окружение может их переопределить.
В StackMaster
Как MariaDB работает в StackMaster
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.
Обзор
Технический профиль MariaDB
Версии
Репозиторий исходного кода
Публичный Helm-чарт
Постоянные тома
Страница базы данных
Стеки
Стеки, в которые входит MariaDB
Данные
Резервные копии и импорт данных: MariaDB
Резервные копии вручную и по расписанию
Создавайте резервную копию, когда она нужна, или задайте расписание в пресете резервного копирования.
Импорт из архива, по URL или из резервной копии
Источником импорта может быть загруженный архив, публичный URL или готовая резервная копия совместимого сервиса.
Где хранятся архивы
StackMaster записывает каждый архив в StackMaster Blob Storage или в бакет у провайдера хранилища, подключённого как интеграция.
Конфигурация
Конфигурация сервиса MariaDB
Тома
Действия
Связанные базы данных