![在 Ubuntu 16.04 LTS 上安装 mysql-server 失败](https://linux22.com/image/1138403/%E5%9C%A8%20Ubuntu%2016.04%20LTS%20%E4%B8%8A%E5%AE%89%E8%A3%85%20mysql-server%20%E5%A4%B1%E8%B4%A5.png)
我花了一天时间在全新安装的 UBUNTU 16.04 LTS 上为 LAMP 服务器安装 mysql。
我尝试了 stackexchange 中与此问题相关的所有操作。
每次都出现同样的问题:
$ sudo apt install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
mailx tinyca
The following NEW packages will be installed
mysql-client mysql-server mysql-server-5.7 mysql-server-core-5.7
0 to upgrade, 4 to newly install, 0 to remove and 0 not to upgrade.
Need to get 10.0 kB/10.1 MB of archives.
After this operation, 94.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client all 5.7.12-0ubuntu1.1 [10.0 kB]
Fetched 10.0 kB in 0s (21.0 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-server-core-5.7.
(Reading database ... 46535 files and directories currently installed.)
Preparing to unpack .../mysql-server-core-5.7_5.7.12-0ubuntu1.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.12-0ubuntu1.1) ...
Selecting previously unselected package mysql-server-5.7.
Preparing to unpack .../mysql-server-5.7_5.7.12-0ubuntu1.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.12-0ubuntu1.1) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../mysql-client_5.7.12-0ubuntu1.1_all.deb ...
Unpacking mysql-client (5.7.12-0ubuntu1.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.12-0ubuntu1.1_all.deb ...
Unpacking mysql-server (5.7.12-0ubuntu1.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up mysql-server-core-5.7 (5.7.12-0ubuntu1.1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
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.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mysql-client (5.7.12-0ubuntu1.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
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
我尝试使用 dpkg 重新配置,完全卸载并重新安装,中间进行硬重启。
有人可以提供一些帮助吗?
[编辑]
systemctl 状态 mysql.service
$ systemctl status mysql.service
Jul 06 19:44:30 xxxxxx.eu systemd[1]: mysql.service: Control process exited, code=exited status=1
Jul 06 19:44:30 xxxxxx.eu systemd[1]: Failed to start MySQL Community Server.
Jul 06 19:44:30 xxxxxx.eu systemd[1]: mysql.service: Unit entered failed state.
Jul 06 19:44:30 xxxxxx.eu systemd[1]: mysql.service: Failed with result 'exit-code'.
Jul 06 19:44:30 xxxxxx.eu systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Jul 06 19:44:30 xxxxxx.eu systemd[1]: Stopped MySQL Community Server.
Jul 06 19:44:30 xxxxxx.eu systemd[1]: mysql.service: Start request repeated too quickly.
Jul 06 19:44:30 xxxxxx.eu systemd[1]: Failed to start MySQL Community Server.
journalctl-xe
$ journalctl -xe
Jul 06 19:57:01 xxxxxxxxx.eu CRON[3608]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 19:57:05 xxxxxxxxx.eu CRON[3607]: pam_unix(cron:session): session closed for user root
Jul 06 19:58:01 xxxxxxxxx.eu CRON[3709]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 19:58:01 xxxxxxxxx.eu CRON[3710]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 19:58:04 xxxxxxxxx.eu CRON[3709]: pam_unix(cron:session): session closed for user root
Jul 06 19:58:24 xxxxxxxxx.eu systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Jul 06 19:58:24 xxxxxxxxx.eu systemd-tmpfiles[3815]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/l
Jul 06 19:58:25 xxxxxxxxx.eu systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
Jul 06 19:59:01 xxxxxxxxx.eu CRON[3818]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 19:59:01 xxxxxxxxx.eu CRON[3819]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 19:59:01 xxxxxxxxx.eu CRON[3818]: pam_unix(cron:session): session closed for user root
Jul 06 20:00:01 xxxxxxxxx.eu CRON[3861]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:00:01 xxxxxxxxx.eu CRON[3862]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:00:01 xxxxxxxxx.eu CRON[3861]: pam_unix(cron:session): session closed for user root
Jul 06 20:01:01 xxxxxxxxx.eu CRON[3930]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:01:01 xxxxxxxxx.eu CRON[3931]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:01:01 xxxxxxxxx.eu CRON[3930]: pam_unix(cron:session): session closed for user root
Jul 06 20:02:01 xxxxxxxxx.eu CRON[3974]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:02:01 xxxxxxxxx.eu CRON[3975]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:02:01 xxxxxxxxx.eu CRON[3974]: pam_unix(cron:session): session closed for user root
Jul 06 20:03:01 xxxxxxxxx.eu CRON[4022]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:03:01 xxxxxxxxx.eu CRON[4023]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:03:02 xxxxxxxxx.eu CRON[4022]: pam_unix(cron:session): session closed for user root
Jul 06 20:04:01 xxxxxxxxx.eu CRON[4065]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:04:01 xxxxxxxxx.eu CRON[4066]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:04:01 xxxxxxxxx.eu CRON[4065]: pam_unix(cron:session): session closed for user root
Jul 06 20:05:01 xxxxxxxxx.eu CRON[4131]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:05:01 xxxxxxxxx.eu CRON[4132]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:05:01 xxxxxxxxx.eu CRON[4131]: pam_unix(cron:session): session closed for user root
Jul 06 20:06:01 xxxxxxxxx.eu CRON[4177]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:06:01 xxxxxxxxx.eu CRON[4178]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:06:01 xxxxxxxxx.eu CRON[4177]: pam_unix(cron:session): session closed for user root
Jul 06 20:07:01 xxxxxxxxx.eu CRON[4220]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 06 20:07:01 xxxxxxxxx.eu CRON[4221]: (root) CMD (/usr/local/rtm/bin/rtm 23 > /dev/null 2> /dev/null)
Jul 06 20:07:01 xxxxxxxxx.eu CRON[4220]: pam_unix(cron:session): session closed for user root