Fix MariaDB backup script
When multiple users are granted access to a database, the MariaDB backup script failed to retrieve the grants for that database, which caused the backup job to fail. This patchset updates the script. Change-Id: I9076b2e7363ae0ec216d4e822f385fa949df8f54
This commit is contained in:
parent
4665fdad03
commit
d86502a7b7
@ -15,7 +15,7 @@ apiVersion: v1
|
|||||||
appVersion: v10.2.31
|
appVersion: v10.2.31
|
||||||
description: OpenStack-Helm MariaDB
|
description: OpenStack-Helm MariaDB
|
||||||
name: mariadb
|
name: mariadb
|
||||||
version: 0.1.2
|
version: 0.1.3
|
||||||
home: https://mariadb.com/kb/en/
|
home: https://mariadb.com/kb/en/
|
||||||
icon: http://badges.mariadb.org/mariadb-badge-180x60.png
|
icon: http://badges.mariadb.org/mariadb-badge-180x60.png
|
||||||
sources:
|
sources:
|
||||||
|
@ -84,7 +84,7 @@ dump_databases_to_directory() {
|
|||||||
do
|
do
|
||||||
echo $($MYSQL --skip-column-names -e "select concat('show grants for ',user,';') \
|
echo $($MYSQL --skip-column-names -e "select concat('show grants for ',user,';') \
|
||||||
from mysql.db where ucase(db)=ucase('$db');") | \
|
from mysql.db where ucase(db)=ucase('$db');") | \
|
||||||
sed -r "s/show grants for ([a-zA-Z0-9_-]*)/show grants for '\1'/" | \
|
sed -r "s/show grants for ([a-zA-Z0-9_-]*)/show grants for '\1'/g" | \
|
||||||
$MYSQL --silent --skip-column-names 2>>$LOG_FILE > $TMP_DIR/${db}_grant.sql
|
$MYSQL --silent --skip-column-names 2>>$LOG_FILE > $TMP_DIR/${db}_grant.sql
|
||||||
if [ "$?" -eq 0 ]
|
if [ "$?" -eq 0 ]
|
||||||
then
|
then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user