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
This commit is contained in:
Vishakha Agarwal 2020-08-17 13:37:48 +05:30
parent 7d6c71ba26
commit b54839f382

View File

@ -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 " sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "
DELETE FROM mysql.user WHERE User=''; DELETE FROM mysql.user WHERE User='';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* CREATE USER '$DB_USER'@'%' IDENTIFIED BY '$DB_PW';
TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;" GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%' WITH GRANT OPTION;"
# Bump the max_connections limit # Bump the max_connections limit
sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e " sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "