我在 mysql 5.5 上安装的 mariadb 出现故障。几个小时以来,我一直尝试使用 apt-get 重新安装 mysql - 尝试清除、删除与 mysql 相关的所有内容。还卸载了 php。Apache 也重新安装了。在配置 mysql-server 期间,每次安装都会抛出错误。我终于设法从网站上的 deb 包成功安装。安装包后,我运行了这个:
sudo apt-get install mysql-server-5.5
安装失败部分:
Setting up mysql-server-5.5 (5.5.35-0ubuntu0.12.04.2) ...
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
No apport report written because MaxReports is reached already
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
No apport report written because MaxReports is reached already
Setting up libmariadbclient18 (10.0.8+maria-1~precise) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
mysql-server-5.5
mysql-server
好吧,所以我跑去sudo dpkg --configure mysql-server-5.5
拿
Setting up mysql-server-5.5 (5.5.35-0ubuntu0.12.04.2) ...
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
Errors were encountered while processing:
mysql-server-5.5
如果我们尝试运行,mysql
则会得到
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
这引导我回到 my.cnf 操作和 mysql 重新安装。该死的,错误循环已经关闭。
我尝试了所有与 mysql 安装相关的解决方案。这里真的没有其他选择,重新安装和配置 ubuntu 会更简单、更快捷。欢迎提供任何反馈。
编辑:一个通知 - 为什么在安装过程中提示我输入 mysql 管理员密码 3 次?
答案1
尝试使用这些命令来完全删除未配置的软件包mysql-server-5.5
,mysql-server
sudo dpkg -P --force-remove-reinstreq mysql-server-5.5
sudo dpkg -P --force-remove-reinstreq mysql-server
然后通过运行再次安装,
sudo apt-get install mysql-server-5.5
sudo apt-get install mysql-server
答案2
对我来说,发生这种情况的原因是根分区已满。检查根分区上有多少可用空间:
df -h
如果空间不足,请查看是什么占用了该空间:
sudo apt-get install ncdu ; sudo ncdu /