dpkg:invoke-rc.d:initscript mysql,动作“启动”失败


19

我在这里阅读了许多帖子,它们都声明可以运行以下命令:

  1. Apt-get -f删除* *
  2. apt-get更新
  3. apt-get升级
  4. apt-get -f安装* *

我已经以各种顺序看到了这些问题,但没有一个问题得到解决。无论我尝试什么,我都会得到:

 apt-get -f install mysql-server                              Reading package 
lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
tinyca mailx
The following NEW packages will be installed:
mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/14.9 MB of archives.
After this operation, 53.0 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
Selecting previously unselected package mysql-server-core-5.5.
(Reading database ... 83134 files and directories currently installed.)
Unpacking mysql-server-core-5.5 (from .../mysql-server-core-5.5_5.5.29-
0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package mysql-server-5.5.
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.29-0ubuntu0.12.04.1_amd64.deb) 
...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.5.29-0ubuntu0.12.04.1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.04.1) ...
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.04.1) ...
invoke-rc.d: initscript mysql, action "start" failed.
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):
No apport report written because the error message indicates its a followup error from a 
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

在过去一周中,我尝试了几件事,但无法解决,请多多帮助。我确实注意到了以下消息:

软件包mysql-server-5.5尚未配置。

而且我尚未对此进行配置,因此我正在该方面进行工作。任何其他帮助将不胜感激。


请将输出结果添加sudo invoke-rc.d mysql start到您的问题中。
Florian Diesch 2013年

这是输出... sudo invoke-rc.d mysql start Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql start Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the start(8) utility, e.g. start mysql start: Job failed to start invoke-rc.d: initscript mysql, action "start" failed.
Titanicx

在对话框中搜索另一个错误后,我能够找到解决此问题的方法
Titanicx

1
dpkg: dependency problems prevent configuration of mysql server: mysql-server depends on mysql-server-5.5; however:`软件包mysql-server-5.5尚未配置。`我偶然发现了这个线程,这使我进入了这个旧线程,其中包含了我迫切需要的答案。我不得不运行 dpkg -S etc/mysql以获取信息,发现仍然安装了mysql-common,这给我带来了麻烦。
Titanicx

2
然后我跑去aptitude purge mysql-server --purge-unused清理文件。这就像一个魅力。希望此解决方案可以帮助其他人!
Titanicx

Answers:


38

Titanicx的解决方案对我有用。然

dpkg -S etc/mysql

看到mysql-common是问题所在。完全删除了MySQL:

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

谢谢。我尝试了许多其他解决方案和许多其他步骤。最后,问题的关键!
bmacnaughton'5

dpkg -S是什么?我的没有这个选择。
Nick Retallack

1

我以前有这个问题。MySQL守护程序将在配置软件包后立即启动,如果MySQL配置中有任何错误或访问数据目录时出现问题,则该作业将失败。

/var/log/mysql/error.log在这种情况下,检查MySQL错误登录可以为您提供帮助。

就我而言,是由apparmor引起的访问错误:

150131 19:38:23  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

它只是通过编辑适当的apparmor文件来解决。


1

我的问题是我在/tmp其他地方有符号链接,而Apparmor不喜欢它。

编辑/etc/apparmor.d/abstractions/user-tmp并添加真实路径以/tmp对其进行修复,并允许MySQL成功启动。

灵感来源


0

如果没有任何帮助,请尝试使用此方法。我从mysql站点下载了deb软件包。然后

sudo apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5 
sudo dpkg -i mysql-5.6.13-debian6.0-i686.deb 
sudo apt-get install mysql-server 

非常感谢Ingo。


0

对我来说,这很简单

apt-get autoremove

得到了:

Setting up mysql-server-5.5 (5.5.38-1~dotdeb.0) ...
update-rc.d: warning: /etc/init.d/mysql missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
mysql start/running, process 21373

0

似乎不需要执行所有这些清除和清除操作。您需要做的就是删除服务器,然后执行:

rm /etc/mysql/ -R

然后安装服务器。

这个想法来自这个线程的答案所引用的外部链接:https : //askubuntu.com/a/448249/109764


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.