2016-07-05 53 views
0

在这里安装MySQL服务器是我收到错误在ubuntu16.04

Setting up mysql-server-5.7 (5.7.12-0ubuntu1.1) ... 
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 
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 man-db (2.7.5-1) ... 
No apport report written because the error message indicates its a followup error from a previous failure. 
          Errors were encountered while processing: 
mysql-server-5.7 
mysql-server 
E: Sub-process /usr/bin/dpkg returned an error code (1) 

如在上面的代码2行表示以下指令后的错误,我得到

$ systemctl status mysql.service 
● mysql.service - MySQL Community Server 
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en 
    Active: activating (start-post) (Result: exit-code) since Tue 2016-07-05 18:2 
    Process: 7822 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) 
    Process: 7819 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exit 
Main PID: 7822 (code=exited, status=1/FAILURE);   : 7823 (mysql-systemd-s 
    CGroup: /system.slice/mysql.service 
      └─control 
      ├─7823 /bin/bash /usr/share/mysql/mysql-systemd-start post 
      └─7874 sleep 1 


$ journalctl -xe 
-- Subject: Unit mysql.service has failed 
-- Defined-By: systemd 
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 
-- 
-- Unit mysql.service has failed. 
-- 
-- The result is failed. 
Jul 05 18:29:59 rahul-HP-2000-Notebook-PC systemd[1]: mysql.service: Unit entere 
Jul 05 18:29:59 rahul-HP-2000-Notebook-PC systemd[1]: mysql.service: Failed with 
Jul 05 18:29:59 rahul-HP-2000-Notebook-PC systemd[1]: mysql.service: Service hol 
Jul 05 18:29:59 rahul-HP-2000-Notebook-PC systemd[1]: Stopped MySQL Community Se 
-- Subject: Unit mysql.service has finished shutting down 
-- Defined-By: systemd 
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 
-- 
-- Unit mysql.service has finished shutting down. 
Jul 05 18:29:59 rahul-HP-2000-Notebook-PC systemd[1]: Starting MySQL Community S 
-- Subject: Unit mysql.service has begun start-up 
-- Defined-By: systemd 
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 
-- 
-- Unit mysql.service has begun starting up. 

我已经尝试重新安装它多次,但它总是显示相同的错误。什么可能是这个错误的原因?

+0

尝试'sudo易于安装mysql服务器的mysql-client' – Shank

+0

这是一个已知的bug,(https://开头的错误。 launchpad.net/ubuntu/+source/mysql-5.7/+bug/1573279) – Shank

+0

@Shank'sudo apt install mysql-server mysql-client'显示相同的错误。 –

回答

1

吹扫删除所有MySQL软件包:

$ sudo apt-get remove --purge mysql* 

$ sudo apt-get autoremove --purge 

如果目录/ etc/MySQL的存在,上述的命令被执行,即使后,然后取出它:

$ sudo rm -rf /etc/mysql 

现在,首先all,安装包mysql-client:

$ sudo apt-get install mysql-client 

最后,安装mysql -c后的包mysql-server lient已成功安装:

$ sudo apt-get install mysql-server 

我试图在链接描述如下所有的解决方案,但没有工作!这是我能解决mysql服务器安装错误的唯一方法。

https://askubuntu.com/questions/766038/error-installing-mysql-on-ubuntu-16-04

https://askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server

https://ubuntuforums.org/showthread.php?t=2325143

https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1573279 https://askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server