Run 'mysql_upgrade' only if this is a fresh install.

This commit is contained in:
Christoph 2017-10-04 12:27:26 +00:00
parent 802fed424b
commit 4dbbfdba15

View File

@ -2374,17 +2374,6 @@ else
error Konnte MySQL Datenbankserver nicht starten..
fi
echononl "Run \"mysql_upgrade -uroot\" - this may take some (long) time.."
echo "" >> ${logdir}/main.log
echo "${MYSQL_INSTALL_DIR}/bin/mysql_upgrade -uroot -p$MYSQL_ROOT_PW" >> ${logdir}/main.log
${MYSQL_INSTALL_DIR}/bin/mysql_upgrade -uroot -p$MYSQL_ROOT_PW >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Script \"mysql_upgrade -uroot\" failed!"
fi
if ! $UPDATE_MYSQL ; then
## - Delete rows with empty 'User' from table mysql.user
@ -2419,9 +2408,26 @@ if ! $UPDATE_MYSQL ; then
echo_failed
error Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen..
fi
else
## - Run mysql_upgrade
## -
echononl "Run \"mysql_upgrade -uroot\" - this may take some (long) time.."
echo "" >> ${logdir}/main.log
echo "${MYSQL_INSTALL_DIR}/bin/mysql_upgrade -uroot -p$MYSQL_ROOT_PW" >> ${logdir}/main.log
${MYSQL_INSTALL_DIR}/bin/mysql_upgrade -uroot -p$MYSQL_ROOT_PW >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Script \"mysql_upgrade -uroot\" failed!"
fi
fi
_sys_maint_cnf_needed=false
if $UPDATE_MYSQL ; then
echononl "Copy 'sys-maint.cnf from old installation to the new one.."