mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
Fixing db importing with new mysql 5.7 installations
This commit is contained in:
@@ -30,6 +30,15 @@ function dbasm_mysqlExec() {
|
|||||||
export MYSQL_PWD=$PROMPT_PASS
|
export MYSQL_PWD=$PROMPT_PASS
|
||||||
|
|
||||||
retval=$("$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "$command")
|
retval=$("$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "$command")
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
err=$("$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "$command" 2>&1 )
|
||||||
|
# it happens on new mysql 5.7 installations
|
||||||
|
# since mysql_native_password is explicit now
|
||||||
|
if [[ "$err" == *"Access denied"* ]]; then
|
||||||
|
echo "Setting mysql_native_password for $PROMPT_USER ..."
|
||||||
|
sudo "$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "ALTER USER '${PROMPT_USER}'@'localhost' IDENTIFIED WITH mysql_native_password BY '${PROMPT_PASS}';"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# create configured account if not exists
|
# create configured account if not exists
|
||||||
"$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "CREATE USER '${MYSQL_USER}'@'${MYSQL_HOST}' IDENTIFIED BY '${MYSQL_PASS}' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;"
|
"$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "CREATE USER '${MYSQL_USER}'@'${MYSQL_HOST}' IDENTIFIED BY '${MYSQL_PASS}' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;"
|
||||||
|
|||||||
Reference in New Issue
Block a user