File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ FORCE_REDO=0
2727# if set, SQL queries & output printed
2828SQL_DEBUG=0
2929
30+ # if set, recreate user accounts unless access to db already ok (existing ones will be deleted, including their privileges)
31+ SQL_RECREATE_USER=1
32+
3033# where are we running now
3134HERE=` hostname -f`
3235
@@ -240,9 +243,11 @@ for CONFIG in "${EXTRA_CONFIG[@]}"; do
240243 fi
241244
242245 for QHOST in " %" " localhost" " ${HERE} " ; do
243- mysqlExecute " drop user \" ${EXTRA_USER[$CONFIG]} \" @\" ${QHOST} \" ;"
244- mysqlExecute " create user \" ${EXTRA_USER[$CONFIG]} \" @\" ${QHOST} \" ;"
245- mysqlExecute " set password for \" ${EXTRA_USER[$CONFIG]} \" @\" ${QHOST} \" = PASSWORD(\" ${EXTRA_PWD[$CONFIG]} \" );"
246+ if [ " $SQL_RECREATE_USER " == " 1" ]; then
247+ mysqlExecute " drop user \" ${EXTRA_USER[$CONFIG]} \" @\" ${QHOST} \" ;"
248+ mysqlExecute " create user \" ${EXTRA_USER[$CONFIG]} \" @\" ${QHOST} \" ;"
249+ mysqlExecute " set password for \" ${EXTRA_USER[$CONFIG]} \" @\" ${QHOST} \" = PASSWORD(\" ${EXTRA_PWD[$CONFIG]} \" );"
250+ fi
246251 mysqlExecute " grant ${EXTRA_PRIVILEGE[$CONFIG]} on $INFOLOGGER_DB_NAME .* to \" ${EXTRA_USER[$CONFIG]} \" @\" ${QHOST} \" ;"
247252 done
248253done
You can’t perform that action at this time.
0 commit comments