gpt4 book ai didi

mysql - ubuntu16.04安装Mysql-server出错

转载 作者:行者123 更新时间:2023-11-29 11:25:54 24 4
gpt4 key购买 nike

这是我遇到的错误

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.

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

最佳答案

使用purge删除所有mysql包:

$ sudo apt-get remove --purge mysql*

$ sudo apt-get autoremove --purge

如果执行上述命令后目录/etc/mysql 仍然存在,则强制删除它:

$ sudo rm -rf /etc/mysql

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

$ sudo apt-get install mysql-client

最后,在成功安装 mysql-client 后安装 mysql-server 包:

$ sudo apt-get install mysql-server

上述命令是我发现修复 mysql-server 上安装错误的唯一方法。

我已经尝试了下面链接中描述的所有解决方案,但没有一个有效!

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

关于mysql - ubuntu16.04安装Mysql-server出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38205886/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com