mysql 更新时候的一个错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-9-jdk is already the newest version (9.0.4+12-4ubuntu2~16.04.4).
openjdk-9-jre is already the newest version (9.0.4+12-4ubuntu2~16.04.4).
The following packages were automatically installed and are no longer required:
containerd libllvm5.0 runc
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3076 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.23-0ubuntu0.16.04.1) ...
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
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
dpkg: dependency problems prevent configuration of mysql-testsuite-5.7:
mysql-testsuite-5.7 depends on mysql-server-5.7 (= 5.7.23-0ubuntu0.16.04.1); however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-testsuite-5.7 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-testsuite:
mysql-testsuite depends on mysql-testsuite-5.7; however:
Package mysql-testsuite-5.7 is not configured yet.
dpkg: error processing package mysql-testsuite (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
Errors were encountered while processing:
mysql-server-5.7
mysql-server
mysql-testsuite-5.7
mysql-testsuite
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ echo $? [mamh@10.0.63.21] 18-09-03 8:18 /home/mamh/work/gerrit
100
出现这个错误估计是我之前吧mysql开机自启动给禁用了。我们可以先 开启 自启动,更新完之后在关闭了
$ sudo systemctl enable mysql
Synchronizing state of mysql.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable mysql
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
$
$ sudo systemctl disable mysql
Synchronizing state of mysql.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable mysql
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
$ sudo service mysql stop