问题描述
我尝试在我的 ubuntu vps 上安装 mysql-server 一段时间没有成功
在全新安装期间(完全清除所有与 mysql 相关的软件包),在安装过程中,它会要求设置 root 密码,之后会显示一个错误屏幕,其中包含:
为 MySQL 管理用户设置密码时出错。 \n这可能是因为帐户已经有密码,或者是因为与 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 相关内容的修复,这与许多其他有类似问题的人不同。
对此问题的任何帮助将不胜感激。
编辑:
在此之后继续或配置安装的任何尝试都只会遇到更多错误消息
最佳办法
尝试清除所有依赖项和 re-install mysql-server。
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-5.5
sudo apt-get install mysql-server
次佳办法
打开你的终端并输入这个
sudo dpkg --configure mysql-server-5.5
它还提到存在一些依赖问题
sudo apt-get install -f
可以帮助您解决该问题。