From b7f2a6bb672f16862e7612946eab9c307b5cb8c0 Mon Sep 17 00:00:00 2001 From: clinton_admin Date: Sat, 25 Apr 2015 18:29:16 -0400 Subject: [PATCH 1/1] mysql-grant-table-drop: quote database and table names Tables with '-' in their name broke the script. --- mysql-grant-table-drop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-grant-table-drop b/mysql-grant-table-drop index 316f3e9..a70911d 100755 --- a/mysql-grant-table-drop +++ b/mysql-grant-table-drop @@ -24,7 +24,7 @@ for DB in $MYSQL_DBS; do for TBL in $MYSQLDB_TABLES; do #echo "OWNER FOR $DB.$TBL is $USER" - `sudo -H mysql -e "GRANT ALL PRIVILEGES ON $DB.$TBL TO $USER@'%.hcoop.net'"`; + sudo -H mysql -e "GRANT ALL PRIVILEGES ON \`$DB\`.\`$TBL\` TO $USER@'%.hcoop.net'"; done -- 2.20.1