MySQL 安装和删除问题

MySQL 安装和删除问题
root@administrator-desktop:/etc/mysql# sudo apt-get remove php5-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5-mysql is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up mysql-server-5.1 (5.1.37-1ubuntu5.5) ...
invoke-rc.d: unknown initscript, /etc/init.d/mysql not found.
the process get hanged here.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess installed post-installation script killed by signal (Interrupt)
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.1; however:
  Package mysql-server-5.1 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.1
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@administrator-desktop:/etc/mysql# 

请帮忙看看问题出在哪里。我在很多地方都遇到了这个问题

答案1

问题在于,mysql-server-5.1 包的安装似乎已损坏。

尝试使用

dpkg -r mysql-server-5.1
apt-get install mysql-server-5.1

删除并重新安装。如果 dpkg 拒绝删除,请尝试添加 --force 标志(并参阅 dpkg --force-help 获取更多帮助)

答案2

尝试创建文件 /etc/init.d/mysql

touch /etc/init.d/mysql

现在删除 mysql-server-5.1

然后您可以重新安装它。

博客 :http://linuxdump.com/?p=89

相关内容