mysql无法启动排查


环境配置

ubuntu 17.04
mysql 5.7

问题描述

发现数据库连不上了. 重装也没有效果.

$ sudo apt install percona-server-server -y                             127 ↵
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
将会同时安装下列软件:
  libdbd-mysql-perl libdbi-perl libmysqlclient20 mysql-client mysql-client-5.7
  mysql-client-core-5.7 mysql-common percona-server-server-5.6
建议安装:
  libmldbm-perl libnet-daemon-perl libsql-statement-perl
下列【新】软件包将被安装:
  libdbd-mysql-perl libdbi-perl libmysqlclient20 mysql-client mysql-client-5.7
  mysql-client-core-5.7 mysql-common percona-server-server
  percona-server-server-5.6
升级了 0 个软件包,新安装了 9 个软件包,要卸载 0 个软件包,有 1 个软件包未被升级。
需要下载 9,828 B/17.3 MB 的归档。
解压缩后会消耗 145 MB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu zesty/universe amd64 percona-server-server all 5.6.22-rel71.0-0ubuntu5 [9,828 B]
已下载 9,828 B,耗时 0秒 (87.9 kB/s)              
正在预设定软件包 ...
正在选中未选择的软件包 mysql-common。
(正在读取数据库 ... 系统当前共安装有 380271 个文件和目录。)
...
正在设置 mysql-client (5.7.20-0ubuntu0.17.04.1) ...
正在设置 percona-server-server-5.6 (5.6.22-rel71.0-0ubuntu5) ...
update-alternatives: 使用 /etc/mysql/percona-server.cnf 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
2017-11-30 23:07:41 0 [Warning] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824
2017-11-30 23:07:41 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2017-11-30 23:07:41 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - LSB: Start and stop the mysql (Percona Server) daemon
   Loaded: loaded (/etc/init.d/mysql; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2017-11-30 23:08:13 CST; 10ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 18849 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
      CPU: 1.747s

11月 30 23:07:59 itaken systemd[1]: Starting LSB: Start and stop the mysq…n...
11月 30 23:07:59 itaken mysql[18849]:  * Starting MySQL (Percona Server) d…qld
11月 30 23:08:13 itaken /etc/init.d/mysql[19800]: 0 processes alive and '/u…in
11月 30 23:08:13 itaken /etc/init.d/mysql[19800]: [52B blob data]
11月 30 23:08:13 itaken mysql[18849]:    ...fail!
11月 30 23:08:13 itaken systemd[1]: mysql.service: Control process exited…us=1
11月 30 23:08:13 itaken systemd[1]: Failed to start LSB: Start and stop t…mon.
11月 30 23:08:13 itaken systemd[1]: mysql.service: Unit entered failed state.
11月 30 23:08:13 itaken systemd[1]: mysql.service: Failed with result 'ex…de'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: 处理软件包 percona-server-server-5.6 (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
dpkg: 依赖关系问题使得 percona-server-server 的配置工作不能继续:
 percona-server-server 依赖于 percona-server-server-5.6;然而:
  软件包 percona-server-server-5.6 尚未配置。

dpkg: 处理软件包 percona-server-server (--configure)时出错:
 依赖关系问题 - 仍未被配置
正在处理用于 libc-bin (2.24-9ubuntu2.2) 的触发器 ...
因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。
                                                                    正在处理用于 systemd (232-21ubuntu7.1) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
在处理时有错误发生:
 percona-server-server-5.6
 percona-server-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

网上查找解决方法, 有一方案说需要nsd, 但是事实上, 安装了也没有用.

$ ll /run | grep rh

$ systemctl status nsd                                                    1 ↵
Unit nsd.service could not be found.
$ sudo apt install nsd                                                    4 ↵
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列【新】软件包将被安装:
  nsd
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 1 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
需要下载 729 kB 的归档。
解压缩后会消耗 2,190 kB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu zesty/universe amd64 nsd amd64 4.1.14-1 [729 kB]
已下载 729 kB,耗时 0秒 (1,570 kB/s)
正在选中未选择的软件包 nsd。
(正在读取数据库 ... 系统当前共安装有 380687 个文件和目录。)
正准备解包 .../nsd_4.1.14-1_amd64.deb  ...
正在解包 nsd (4.1.14-1) ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
正在设置 percona-server-server-5.6 (5.6.22-rel71.0-0ubuntu5) ...
2017-11-30 23:34:58 0 [Warning] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824
2017-11-30 23:34:58 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2017-11-30 23:34:58 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - LSB: Start and stop the mysql (Percona Server) daemon
   Loaded: loaded (/etc/init.d/mysql; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2017-11-30 23:35:14 CST; 9ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 22248 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
      CPU: 1.755s

11月 30 23:35:00 itaken systemd[1]: Starting LSB: Start and stop the mysq…n...
11月 30 23:35:00 itaken mysql[22248]:  * Starting MySQL (Percona Server) d…qld
11月 30 23:35:14 itaken mysql[22248]:    ...fail!
11月 30 23:35:14 itaken systemd[1]: mysql.service: Control process exited…us=1
11月 30 23:35:14 itaken systemd[1]: Failed to start LSB: Start and stop t…mon.
11月 30 23:35:14 itaken systemd[1]: mysql.service: Unit entered failed state.
11月 30 23:35:14 itaken systemd[1]: mysql.service: Failed with result 'ex…de'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: 处理软件包 percona-server-server-5.6 (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
正在设置 nsd (4.1.14-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nsd.service → /lib/systemd/system/nsd.service.
正在处理用于 systemd (232-21ubuntu7.1) 的触发器 ...
正在处理用于 man-db (2.7.6.1-2) 的触发器 ...
dpkg: 依赖关系问题使得 percona-server-server 的配置工作不能继续:
 percona-server-server 依赖于 percona-server-server-5.6;然而:
  软件包 percona-server-server-5.6 尚未配置。

dpkg: 处理软件包 percona-server-server (--configure)时出错:
 依赖关系问题 - 仍未被配置
因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。
                                                                    正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
在处理时有错误发生:
 percona-server-server-5.6
 percona-server-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

使用sudo apt install -f , 也无法修复.

$ sudo dpkg --purge --force-all percona-server-server
(正在读取数据库 ... 系统当前共安装有 380791 个文件和目录。)
正在卸载 percona-server-server (5.6.22-rel71.0-0ubuntu5)
...

解决方法

还是没有找到解决.


参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录