我一直试图在我的 ubuntu vps 上安装 mysql-server,但没有成功
在全新安装(完全清除所有与 mysql 相关的软件包)的过程中,安装过程中会要求设置 root 密码,之后会显示一个错误屏幕,其中包含以下内容:
设置 MySQL 管理用户的密码时出错。这可能是因为该帐户已有密码,或者由于与 MySQL 服务器的通信问题。
Unpacking mysql-server (from .../mysql-server_5.5.34-0ubuntu0.12.04.1_all.deb) ...
Processing triggers for man-db ...
Setting up libmysqlclient18 (5.5.34-0ubuntu0.12.04.1) ...
Setting up libdbd-mysql-perl (4.020-1build2) ...
Setting up mysql-client-core-5.5 (5.5.34-0ubuntu0.12.04.1) ...
Setting up mysql-client-5.5 (5.5.34-0ubuntu0.12.04.1) ...
Setting up mysql-server-core-5.5 (5.5.34-0ubuntu0.12.04.1) ...
Setting up mysql-server-5.5 (5.5.34-0ubuntu0.12.04.1) ...
131130 18:01:34 [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.
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--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.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
No apport report written because the error message indicates its a followup error from a previous failure.
ldconfig deferred processing now taking place
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试修复了一些涉及 apparmor 相关的东西,然后才意识到错误日志中没有提到 apparmor,这与许多其他遇到类似问题的人不同。
任何有关此事的帮助都将不胜感激。
编辑:
在此之后继续或配置安装的任何尝试都只会遇到进一步的错误消息
答案1
尝试清除所有依赖项并重新安装 mysql-server。
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-5.5
sudo apt-get install mysql-server
答案2
打开终端并输入
sudo dpkg --configure mysql-server-5.5
它还提到存在一些依赖关系问题
sudo apt-get install -f
可以帮助您解决该问题。
答案3
事实上,下面的错误报告对我帮助很大:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739846
以下命令可以完成该工作:
echo "exit 0" >> /etc/init.d/mysql
dpkg --configure -a
但是我必须对其进行两次配置(第二条命令)。