2013-08-30 181 views
1

在我重新启动mysql(通过/etc/init.d/mysql restart)重启之前,它工作正常,我配置了电子邮件服务器。我很确定我没有碰到任何东西,但我记得在此之前做了一次失败的apt-get更新。MySQL不会在Ubuntu 11.04上安装

现在我的问题开始时突然停止,甚至不会开始。我搜索谷歌,甚至去清除一切,并做一个新的安装。但仍然不会让我正确安装mysql。

我试着(做了删除--purge后):

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

和它提示我根密码时应,但返回我下面的错误:

Unable to set password for the MySQL "root" user              

    An error occurred while setting the password for the MySQL administrative user. This may have   
    happened because the account already has a password, or because of a communication problem with the 
    MySQL server.                       

    You should check the account's password after the package installation.        

    Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information. 

和我也有以下日志:

Selecting previously deselected package mysql-server-5.5. 
(Reading database ... 117879 files and directories currently installed.) 
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.32-0ubuntu0.12.04.1_amd64.deb) ... 
Processing triggers for man-db ... 
Processing triggers for ureadahead ... 
Setting up mysql-server-5.5 (5.5.32-0ubuntu0.12.04.1) ... 
130830 14:13:26 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 
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 
E: Sub-process /usr/bin/dpkg returned an error code (1) 

有帮助吗?提前致谢。

回答

2

这个问题是通过卸载解决了同样的问题,但在此之前,他试图设置密码是question,然后他试图解决它在chat也许当你尝试设置密码它将被解决,只需尝试

更新:在您的终端中键入以下命令,以便为mysql做一个完整的删除。

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

而且你需要删除/ var/lib中/ MySQL的文件夹,如果存在通过键入以下命令

sudo rm -rf /var/lib/mysql 

然后按照official ubuntu documentation安装。并且不要忘记在安装过程中设置你的mysql密码。

也看到这个question它类似于你在安装过程中得到的错误。

+0

我做索姆e卸载然后再次安装。我甚至更新了Ubuntu版本,但仍然没有成功。 – ajib

+0

您是否尝试重置密码? –

+0

我不明白你的意思是密码。你是指mysql的root帐号?如果是,那么答案是否定的。在系统上重新安装mysql-server时实际发生此错误。我似乎无法继续安装它,因为它给我带来这个错误。 – ajib

2

我遇到过这个问题。 也许aptitude有一些配置包。 我觉得这个干扰问题 虽然,这个方法是purge命令。 尝试运行。

  1. 检查mysql安装包

    dpkg --get-selections|grep mysql

  2. 删除

    apt-get remove --purge [installed package]
    apt-get autoremove
    apt-get autoclean
    aptitude purge [installed package]
    aptitude clean
    aptitude update
    aptitude -f install
    aptitude full-upgrade

  3. 安装

    apt-get install mysql-server