我正在运行Ubuntu 16.04(干净安装 - 没有升级)。 MySQL运行正常 - 但是当我尝试更新MySQL时出现此错误:
apt-get install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.7 (5.7.16-0ubuntu0.16.04.1) ...
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv OK
mysql.db OK
mysql.engine_cost OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.gtid_executed OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.server_cost OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
The sys schema is already up to date (version 1.5.1).
Checking databases.
ALL DATABASES RETURNED OK
Error occurred: Error during call to mysql_check.
mysql_upgrade failed with exit status 4
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
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)
虽然它正在运行,但我不喜欢错误。你们有任何想法如何解决这个问题吗?
运行dpkg -l | grep mysql给出:
dpkg -l | grep mysql
ii libdbd-mysql-perl 4.033-1ubuntu0.1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient20:amd64 5.7.16-0ubuntu0.16.04.1 amd64 MySQL database client library
ii mysql-client 5.7.16-0ubuntu0.16.04.1 all MySQL database client (metapackage depending on the latest version)
ii mysql-client-5.7 5.7.16-0ubuntu0.16.04.1 amd64 MySQL database client binaries
ii mysql-client-core-5.7 5.7.16-0ubuntu0.16.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.7.16-0ubuntu0.16.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
iU mysql-server 5.7.16-0ubuntu0.16.04.1 all MySQL database server (metapackage depending on the latest version)
iF mysql-server-5.7 5.7.16-0ubuntu0.16.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.7 5.7.16-0ubuntu0.16.04.1 amd64 MySQL database server binaries
ii php-mysql 1:7.0+45+deb.sury.org~xenial+1 all MySQL module for PHP [default]
ii php5.6-mysql 5.6.27-1+deb.sury.org~xenial+1 amd64 MySQL module for PHP
ii php7.0-mysql 7.0.12-1+deb.sury.org~xenial+1 amd64 MySQL module for PHP
由于
答案 0 :(得分:1)
我自己遇到了这个问题,我认为这与升级过程如何停止/启动/重新启动MySQL有关。
这是我在尝试升级MySQL失败后所做的解决方法。
在某些时候,我会进一步深入研究为什么“mysql_upgrade ...”调用在升级过程中失败,而不是单独从命令行调用。但是我没有经历过几次升级迭代而没有使用这种方法的问题。
希望这有帮助。
“握
答案 1 :(得分:0)
注意:这是用于使用" mysql_secure_installation "升级MySQL。固定。
在Ubuntu 16.04中升级MySQL Server 5.7时出现问题,我终于找到了问题所在。我启用了" mysql_secure_installation"在我的第一次安装期间导致升级脚本因密码创建错误而失败(升级脚本中自动生成的密码的未满足的特殊字符要求)。
在运行&sudo apt upgrade'或者' sudo apt install -f',可以使用此命令跟踪错误:
tail -f /var/log/mysql/error.log
就我而言,日志显示:
[错误] 1819您的密码不符合当前政策 要求
要解决此问题,请登录mysql并暂时禁用MySQL的验证密码插件:
mysql -u root -p -h 127.0.0.1
的MySQL>卸载插件validate_password;
的MySQL>出口
确保停止先前的升级/安装并重新运行升级/安装。完成后,登录mysql并启用MySQL的验证密码插件;
mysql -u root -p -h 127.0.0.1
的MySQL>安装插件validate_password SONAME' validate_password.so';
的MySQL>出口
答案 2 :(得分:0)
我以前遇到过此问题,此问题的根本原因是更改了数据库配置。
我更改了lower_case_table_names = 1
并将其值设置为1,而当我尝试升级它时,由于您在问题中遇到的错误而失败。
要解决此问题,我只需将值设置为0,重新启动数据库,升级对我来说就很好。
首先编辑配置:
sudo nano /etc/mysql/my.cnf
更改此行:
lower_case_table_names = 0
重新启动数据库
sudo /etc/init.d/mysql restart
然后运行升级命令