diff --git a/docker-compose.yml b/docker-compose.yml index ccadacb4..ad578523 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -48,7 +48,7 @@ services: image: aurweb:latest init: true entrypoint: /docker/mariadb-entrypoint.sh - command: /usr/bin/mysqld_safe --datadir=/var/lib/mysql + command: /usr/bin/mariadbd-safe --datadir=/var/lib/mysql ports: # This will expose mariadbd on 127.0.0.1:13306 in the host. # Ex: `mysql -uaur -paur -h 127.0.0.1 -P 13306 aurweb` @@ -80,7 +80,7 @@ services: environment: - MARIADB_PRIVILEGED=1 entrypoint: /docker/mariadb-entrypoint.sh - command: /usr/bin/mysqld_safe --datadir=/var/lib/mysql + command: /usr/bin/mariadbd-safe --datadir=/var/lib/mysql ports: # This will expose mariadbd on 127.0.0.1:13307 in the host. # Ex: `mysql -uaur -paur -h 127.0.0.1 -P 13306 aurweb` diff --git a/docker/README.md b/docker/README.md index 51e485f6..e473582b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -47,7 +47,7 @@ Luckily such data can be generated. docker compose exec fastapi /bin/bash pacman -S words fortune-mod ./schema/gendummydata.py dummy.sql -mysql aurweb < dummy.sql +mariadb aurweb < dummy.sql ``` The generation script may prompt you to install other Arch packages before it diff --git a/docker/health/mariadb.sh b/docker/health/mariadb.sh index cbae37bd..a75089ad 100755 --- a/docker/health/mariadb.sh +++ b/docker/health/mariadb.sh @@ -1,2 +1,2 @@ #!/bin/bash -exec mysqladmin ping --silent +exec mariadb-admin ping --silent diff --git a/docker/mariadb-entrypoint.sh b/docker/mariadb-entrypoint.sh index a6fb9a76..432b591b 100755 --- a/docker/mariadb-entrypoint.sh +++ b/docker/mariadb-entrypoint.sh @@ -6,8 +6,8 @@ MYSQL_DATA=/var/lib/mysql mariadb-install-db --user=mysql --basedir=/usr --datadir=$MYSQL_DATA # Start it up. -mysqld_safe --datadir=$MYSQL_DATA --skip-networking & -while ! mysqladmin ping 2>/dev/null; do +mariadbd-safe --datadir=$MYSQL_DATA --skip-networking & +while ! mariadb-admin ping 2>/dev/null; do sleep 1s done @@ -15,17 +15,17 @@ done DATABASE="aurweb" # Persistent database for fastapi. echo "Taking care of primary database '${DATABASE}'..." -mysql -u root -e "CREATE USER IF NOT EXISTS 'aur'@'localhost' IDENTIFIED BY 'aur';" -mysql -u root -e "CREATE USER IF NOT EXISTS 'aur'@'%' IDENTIFIED BY 'aur';" -mysql -u root -e "CREATE DATABASE IF NOT EXISTS $DATABASE;" +mariadb -u root -e "CREATE USER IF NOT EXISTS 'aur'@'localhost' IDENTIFIED BY 'aur';" +mariadb -u root -e "CREATE USER IF NOT EXISTS 'aur'@'%' IDENTIFIED BY 'aur';" +mariadb -u root -e "CREATE DATABASE IF NOT EXISTS $DATABASE;" -mysql -u root -e "CREATE USER IF NOT EXISTS 'aur'@'%' IDENTIFIED BY 'aur';" -mysql -u root -e "GRANT ALL ON aurweb.* TO 'aur'@'localhost';" -mysql -u root -e "GRANT ALL ON aurweb.* TO 'aur'@'%';" +mariadb -u root -e "CREATE USER IF NOT EXISTS 'aur'@'%' IDENTIFIED BY 'aur';" +mariadb -u root -e "GRANT ALL ON aurweb.* TO 'aur'@'localhost';" +mariadb -u root -e "GRANT ALL ON aurweb.* TO 'aur'@'%';" -mysql -u root -e "CREATE USER IF NOT EXISTS 'root'@'%' IDENTIFIED BY 'aur';" -mysql -u root -e "GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;" +mariadb -u root -e "CREATE USER IF NOT EXISTS 'root'@'%' IDENTIFIED BY 'aur';" +mariadb -u root -e "GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;" -mysqladmin -uroot shutdown +mariadb-admin -uroot shutdown exec "$@"