From 9abb26d69666e836d310ad769d65cb811e2708e7 Mon Sep 17 00:00:00 2001 From: Jens Rosenboom Date: Wed, 7 Dec 2016 21:12:55 +0100 Subject: [PATCH] Try to set initial mysql root password also on Ubuntu On Ubuntu nodes, devstack tries to predefine the initial mysql root password by doing some debconf-set-selections, but these will not take effect if the corresponding package has been installed earlier. So just try to set it every time, like we do on other distros. Change-Id: I2c167051fc5e53dd0ccf82a60ab085cd9cdea28d --- lib/databases/mysql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/databases/mysql b/lib/databases/mysql index f6cc9224af..89ae082c81 100644 --- a/lib/databases/mysql +++ b/lib/databases/mysql @@ -82,10 +82,9 @@ function configure_database_mysql { fi # Set the root password - only works the first time. For Ubuntu, we already - # did that with debconf before installing the package. - if ! is_ubuntu; then - sudo mysqladmin -u root password $DATABASE_PASSWORD || true - fi + # did that with debconf before installing the package, but we still try, + # because the package might have been installed already. + sudo mysqladmin -u root password $DATABASE_PASSWORD || true # Update the DB to give user '$DATABASE_USER'@'%' full control of the all databases: sudo mysql -uroot -p$DATABASE_PASSWORD -h127.0.0.1 -e "GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'%' identified by '$DATABASE_PASSWORD';"