22

这似乎是 12.04 上的一个常见问题。我已经尝试了这个线程中的所有内容,包括:

sudo apt-get clean

sudo apt-get autoclean

sudo apt-get remove --purge mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5

sudo apt-get install mysql-server

我仍然遇到同样的错误。安装/启动 MySql5.5 如下所示:

apt-get install -f mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up mysql-server-5.5 (5.5.24-0ubuntu0.12.04.1) ...
120907 21:37:15 [Note] Plugin 'FEDERATED' is disabled.
120907 21:37:15 InnoDB: The InnoDB memory heap is disabled
120907 21:37:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120907 21:37:15 InnoDB: Compressed tables use zlib 1.2.3.4
120907 21:37:15 InnoDB: Initializing buffer pool, size = 128.0M
120907 21:37:15 InnoDB: Completed initialization of buffer pool
120907 21:37:15 InnoDB: highest supported file format is Barracuda.
120907 21:37:15  InnoDB: Waiting for the background threads to start
120907 21:37:16 InnoDB: 1.1.8 started; log sequence number 154164236
120907 21:37:16  InnoDB: Starting shutdown...
120907 21:37:16  InnoDB: Shutdown completed; log sequence number 154164236
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
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.5
 mysql-server

此外,dpkg-reconfigure mysql-server-5.5退货/usr/sbin/dpkg-reconfigure: mysql-server-5.5 is broken or not fully installed

这里的最终目标是安装和配置 Gitorious 以与 Redmine 一起使用,但我相信问题与 Ubuntu 12.04 和 MySql5.5 无关

4

11 回答 11

53

我找到了这一步的解决方案:

警告:以下步骤将删除您现有的数据!请先备份!!!

$ sudo apt-get --yes autoremove --purge mysql-server-5.5

$ sudo apt-get --yes autoremove --purge mysql-client-5.5

$ sudo apt-get --yes autoremove --purge mysql-common

$ sudo rm -rf /var/lib/mysql /etc/mysql ~/.mysql



$ sudo deluser mysql

$ sudo apt-get autoclean

$ sudo apt-get update && sudo apt-get upgrade

$ sudo apt-get install mysql-server-5.5 mysql-client-5.5

注意:当您收到“dpkg:错误...”时,请运行以下步骤:

$ sudo dpkg --configure -a

祝你好运!

于 2013-08-27T03:44:11.210 回答
7

来自 Ubuntu 论坛的修复:

这对我有用,虽然我是在安装而不是升级,所以我不关心现有的数据库。

我再次删除了所有 mysql 应用程序,然后我去删除了我的 /var/lib/mysql 目录。请记住,如果您在那里有一个现有的数据库,您将丢失它。您可能希望将其移动到另一个位置。

删除该目录后,我再次安装,它运行完美。所以 /var/lib/mysql 目录中的某些东西是我的问题。看看这是否适合你。

于 2013-02-22T17:09:11.170 回答
4

有同样的问题,尝试使用 aptitude 安装并发现该错误

Setting up mysql-server-5.5 (5.5.41-0ubuntu0.14.04.1) ...
/var/lib/dpkg/info/mysql-server-5.5.postinst: line 146: logger: command not found
ATTENTION: An error has occured. More info is in the syslog!
/var/lib/dpkg/info/mysql-server-5.5.postinst: line 236: logger: command not found
dpkg: error processing package mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 127

安装 bsdutils 后,

apt-get install bsdutils

mysql安装正常通过

于 2015-03-09T15:56:29.800 回答
3

确保

auto lo                          
iface lo inet loopback

仍然存在于你的/etc/network/interfaces

于 2014-03-02T17:01:31.593 回答
2

只想加我的 5 美分。它可能会帮助其他人。

在寻找并尝试了各种解决方案之后,没有大刀阔斧的卸载和清除,我的解决方案非常简单。

我的磁盘已满!我不敢相信我没有先检查。清除它,嘿presto!

于 2014-12-03T11:54:56.407 回答
1

我尝试了上面的所有方法,但仍然无法安装。我终于得到了这篇文章:http ://www.randomhacks.co.uk/mysql-job-failed-to-start-unable-to-set-root-password-cant-find-file-mysql/

它建议删除类似于上述内容的文件夹,并运行

dpkg --get-selections | grep mysql
sudo apt-get remove --purge [everything that came up]
sudo apt-get autoremove && sudo apt-get autoclean
sudo apt-get install mysql-server
于 2014-06-14T19:07:39.637 回答
0

我多次遇到这个问题。我可以为这个拼图添加另一个解决方案......

警告:以下步骤将删除您的数据!先做好备份!

你必须:

rm -rf /var/lib/mysql rm -rf /etc/mysql

验证接口“lo”是否已启动,并且“lo”(iptables)上允许流量。

希望能帮助别人!

于 2013-10-13T19:15:03.333 回答
0

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-apt-config_0.2.1-1ubuntu14.04_all.deb

dpkg -i mysql-apt-config_0.2.1-1ubuntu14.04_all.deb

apt-get update

apt-get install mysql-server 
于 2014-10-03T20:49:12.380 回答
0

我无法通过清除/手动删除/mysql / ubuntu 论坛建议我做的任何事情来解决这个问题

相反,我的解决方案是:

1) 增加运行 Ubuntu 的虚拟机的内存

2)检查 /var/log/mysql/error.log 后,我发现无法在 /tmp 创建特定文件:

无法创建/写入文件“/tmp/ibeDIRhT”(错误代码:13)InnoDB:错误:无法创建临时文件;错误号:13

我只是 chmod(ed) /tmp 允许这样做。

瞧,下一次安装 mysql 的尝试成功了。

万一有人遇到这个问题,清除并不总是解决方案,您应该检查日志以查看您有什么错误消息。这可能会有所帮助

于 2014-09-24T14:42:44.403 回答
0

我浪费了很多时间试图解决这个问题,最后结果证明它只需要对/tmp目录的完全权限(我尝试了 755 和 766 但没有用,只有 777 有效),所以我跑了:

sudo chmod 1777 /tmp

“777 之前的数字 1 被称为sticky bit,它为文件夹增加了额外的安全性,请查看以获取有关粘性位的更多详细信息”。

并重新配置:

sudo dpkg --configure mysql-server-5.5

和mysql服务器成功启动。

于 2015-06-20T00:10:02.333 回答
0

从 MySQL 切换到 MariaDB 时也会发生此错误 ( https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071 )。

MySQL 二进制数据文件与 MariaDB 不兼容,所以我切换回 MySQL,因为我没有时间弄乱 mysqldump。

首先,我必须将 MariaDB数据/var/lib/mysql从./var/lib/mysql-5.7/var/lib/mysql

于 2017-11-06T16:57:10.187 回答