From f653eecb97edfcb78ba8951eaa9576141ddc452e Mon Sep 17 00:00:00 2001 From: Simon Westphahl Date: Tue, 21 Feb 2023 13:55:06 +0100 Subject: Fix user creation in Docker test setup script MySQL 8 no longer supports implicitly creating a user using the GRANT statement. Use a separate CREATE USER statement instead. ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'openstack_citest' WITH GRANT OPTION' at line 1 Change-Id: I4cab4c1855d1ba97cbfc9dd0835b3d302d73aa62 --- tools/test-setup-docker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/test-setup-docker.sh b/tools/test-setup-docker.sh index a0fcf9f5a..1601b11a7 100755 --- a/tools/test-setup-docker.sh +++ b/tools/test-setup-docker.sh @@ -58,7 +58,8 @@ timeout 30 bash -c "until ${ROOTCMD} ${MYSQL} -e 'show databases'; do sleep 0.5; echo echo "Setting up permissions for zuul tests" -${ROOTCMD} ${MYSQL} -e "GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest'@'%' identified by 'openstack_citest' WITH GRANT OPTION;" +${ROOTCMD} ${MYSQL} -e "CREATE USER 'openstack_citest'@'%' identified by 'openstack_citest';" +${ROOTCMD} ${MYSQL} -e "GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest'@'%' WITH GRANT OPTION;" ${ROOTCMD} ${MYSQL} -u openstack_citest -popenstack_citest -e "SET default_storage_engine=MYISAM; DROP DATABASE IF EXISTS openstack_citest; CREATE DATABASE openstack_citest CHARACTER SET utf8;" echo "Finished" -- cgit v1.2.1