From b54839f382b046b7ec8b9633fbea763d31d9949c Mon Sep 17 00:00:00 2001 From: Vishakha Agarwal Date: Mon, 17 Aug 2020 13:37:48 +0530 Subject: [PATCH] Fix user creation with GRANT in MySQL 8.0(Ubuntu Focal) In Ubuntu Bionic (18.04) mysql 5.7 version used to create the user implicitly when using using the GRANT. Ubuntu Focal (20.04) has mysql 8.0 and with mysql 8.0 there is no implicit user creation with GRANT. We need to create the user first before using GRANT command. This patch updates tools/test-setup.sh so that keystone supports ubuntu focal. Story: #2007865 Task: #40190 Change-Id: I86d10729cfc7c02f12df611b56f6e263969dfe4b Closes-Bug: #1885825 --- tools/test-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test-setup.sh b/tools/test-setup.sh index 0743c82cea..83399ec5a5 100755 --- a/tools/test-setup.sh +++ b/tools/test-setup.sh @@ -23,8 +23,8 @@ sudo -H mysqladmin -u root password $DB_ROOT_PW sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e " DELETE FROM mysql.user WHERE User=''; FLUSH PRIVILEGES; - GRANT ALL PRIVILEGES ON *.* - TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;" + CREATE USER '$DB_USER'@'%' IDENTIFIED BY '$DB_PW'; + GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%' WITH GRANT OPTION;" # Bump the max_connections limit sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "