无法升级mysql-server-5.7

kmb7vmvb  于 2021-06-17  发布在  Mysql
关注(0)|答案(1)|浏览(371)

在执行apt-get升级时,在升级mysql-server-5.7时,我不断遇到以下错误
以下错误:

Setting up mysql-server-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Checking if update is needed.
Checking server version.
Error occurred: Query against mysql.user table failed when checking the mysql.session.
mysql_upgrade failed with exit status 5
dpkg: error processing package mysql-server-5.7 (--configure):
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates it's a follow-up error from a previous failure.
                                                                                                            dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

尝试删除mysql server和mysql-server-5.7,出现相同错误。清除也会导致相同的错误

3lxsmp7m

3lxsmp7m1#

您可以尝试手动删除包

su -c 'dpkg - P -remove --force-all mysql*'

然后需要重建rum数据库

su -c 'apt-get clean all && rpm --rebuilddb'
su -c 'package-cleanup --problems'

编辑
备份所有数据库

mysqldump -u USER -p --all-databases > /mnt/backups/all_databases.sql

相关问题