create_database.sh: remove giving Super_priv to created user..
This commit is contained in:
parent
7ea7de9990
commit
3baebe1300
@ -463,9 +463,19 @@ if [[ $MAJOR_VERSION -gt 8 ]] \
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
echononl " Grant full access to user '$DATABASE_USER' on Database '$DATABASE_NAME'"
|
echononl " Grant usage to user '$DATABASE_USER' (Creates User..)"
|
||||||
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e \
|
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e \
|
||||||
"GRANT ALL ON ${DATABASE_NAME}.* TO '$DATABASE_USER'@'localhost' IDENTIFIED BY '$DATABASE_PASSWD'" > $tmp_log_file 2>&1
|
"GRANT USAGE ON *.* TO '$DATABASE_USER'@'localhost' IDENTIFIED BY '$DATABASE_PASSWD'" > $tmp_log_file 2>&1
|
||||||
|
if [[ $? -ne 0 ]] ; then
|
||||||
|
echo_failed
|
||||||
|
error "$(cat $tmp_log_file)"
|
||||||
|
else
|
||||||
|
echo_ok
|
||||||
|
fi
|
||||||
|
|
||||||
|
echononl " Grant all privileges to user '$DATABASE_USER' on Database '$DATABASE_NAME'"
|
||||||
|
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e \
|
||||||
|
"GRANT ALL PRIVILEGES ON ${DATABASE_NAME}.* TO '$DATABASE_USER'@'localhost'" > $tmp_log_file 2>&1
|
||||||
if [[ $? -ne 0 ]] ; then
|
if [[ $? -ne 0 ]] ; then
|
||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat $tmp_log_file)"
|
error "$(cat $tmp_log_file)"
|
||||||
@ -475,15 +485,15 @@ else
|
|||||||
|
|
||||||
fi # if [[ $MAJOR_VERSION -ge 8 ]]
|
fi # if [[ $MAJOR_VERSION -ge 8 ]]
|
||||||
|
|
||||||
echononl " Also grant 'Super_priv' privilege to '$DATABASE_USER' on Database '$DATABASE_NAME'"
|
#echononl " Also grant 'Super_priv' privilege to '$DATABASE_USER' on Database '$DATABASE_NAME'"
|
||||||
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e \
|
#mysql $MYSQL_CREDENTIAL_ARGS -N -s -e \
|
||||||
"USE mysql; UPDATE user SET Super_priv = 'Y' WHERE User = '$DATABASE_USER'" > $tmp_log_file 2>&1
|
# "USE mysql; UPDATE user SET Super_priv = 'Y' WHERE User = '$DATABASE_USER'" > $tmp_log_file 2>&1
|
||||||
if [[ $? -ne 0 ]] ; then
|
#if [[ $? -ne 0 ]] ; then
|
||||||
echo_failed
|
# echo_failed
|
||||||
error "$(cat $tmp_log_file)"
|
# error "$(cat $tmp_log_file)"
|
||||||
else
|
#else
|
||||||
echo_ok
|
# echo_ok
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
echononl " Flush Privileges.."
|
echononl " Flush Privileges.."
|
||||||
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e "FLUSH PRIVILEGES" > $tmp_log_file 2>&1
|
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e "FLUSH PRIVILEGES" > $tmp_log_file 2>&1
|
||||||
|
Loading…
Reference in New Issue
Block a user