THIS IS IN TESTING!
This article assumes MariaDB is already installed as a Docker Container using a stack similar to this:
---
services:
mariadb:
image: lscr.io/linuxserver/mariadb:latest
container_name: mariadb
environment:
- PUID=1000
- PGID=1000
- TZ=London/Europe
- MYSQL_ROOT_PASSWORD=SECRET PASSWORD
volumes:
- /docker/mariadb/config:/config
ports:
- 3306:3306
restart: unless-stopped
Log into the MariaDB using: mysql -u root -p
To create a database: CREATE DATABASE
database_name;
To create a user with password: CREATE USER '
user1'@'%' IDENTIFIED BY '
password1';
To give the user access to the database: GRANT ALL PRIVILEGES ON
database_name.* TO '
user1'@'%';
To complete the process: FLUSH PRIVILEGES;