Merge "Mariadb: Display error if user is not create"

This commit is contained in:
Zuul 2019-04-23 02:02:14 +00:00 committed by Gerrit Code Review
commit a0360d07ea

View File

@ -18,7 +18,10 @@ limitations under the License.
set -e
mysql --defaults-file=/etc/mysql/admin_user.cnf -e \
if ! mysql --defaults-file=/etc/mysql/admin_user.cnf -e \
"CREATE OR REPLACE USER '${EXPORTER_USER}'@'%' IDENTIFIED BY '${EXPORTER_PASSWORD}'; \
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO '${EXPORTER_USER}'@'%'; \
FLUSH PRIVILEGES;"
FLUSH PRIVILEGES;" ; then
echo "ERROR: Could not create user: ${EXPORTER_USER}"
exit 1
fi