From 54101310a98fb156c806589d054ac127ac67ff6e Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Sat, 23 Nov 2024 10:45:26 +0100 Subject: [PATCH] Use our standard script to create database --- .github/jobs/baseinstall.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/jobs/baseinstall.sh b/.github/jobs/baseinstall.sh index 2693b2406e..72f72245ae 100755 --- a/.github/jobs/baseinstall.sh +++ b/.github/jobs/baseinstall.sh @@ -54,17 +54,15 @@ password=root EOF cat ~/.my.cnf -mysql_root "CREATE DATABASE IF NOT EXISTS \`domjudge\` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" -mysql_root "CREATE USER IF NOT EXISTS \`domjudge\`@'%' IDENTIFIED BY 'domjudge';" -mysql_root "GRANT SELECT, INSERT, UPDATE, DELETE ON \`domjudge\`.* TO 'domjudge'@'%';" -mysql_root "FLUSH PRIVILEGES;" +echo 'unused:sqlserver:domjudge:domjudge:domjudge_db-pw+% #$*)@(!/;,.:3306' > /opt/domjudge/domserver/etc/dbpasswords.secret + +/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot create-db-users # Show some MySQL debugging mysql_root "show databases" mysql_root "SELECT CURRENT_USER();" mysql_root "SELECT USER();" mysql_root "SELECT user,host FROM mysql.user" -echo 'unused:sqlserver:domjudge:domjudge:domjudge_db-pw+% #$*)@(!/;,.:3306' > /opt/domjudge/domserver/etc/dbpasswords.secret section_end if [ "${db}" = "install" ]; then