安装 mysql-server-5.1 时出错

安装 mysql-server-5.1 时出错

我需要在 ubuntu 11.10 上安装 mysql-server-5.1。使用 apt-get 安装时,我遇到了

dpkg: error processing mysql-server-5.1 (--configure): subprocess installed post-installation script returned error exit status 1

我尝试过以下事情:

sudo apt-get purge mysql-common

重启机器并再次尝试通过运行安装 mysql sudo apt-get install mysql-server-5.1,但没有成功。我仍然收到类似的错误。

在 SYSLOG 中我收到以下几行:

Dec 11 20:26:02 ubuntu mysqld[11272]: 111211 20:26:02  InnoDB: Shutdown completed; log sequence number 0 145554
Dec 11 20:26:02 ubuntu mysqld[11272]: 111211 20:26:02 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 11 20:26:02 ubuntu mysqld[11272]: 
Dec 11 20:26:02 ubuntu mysqld[11291]: 111211 20:26:02 [Note] Plugin 'FEDERATED' is disabled.
Dec 11 20:26:02 ubuntu mysqld[11291]: 111211 20:26:02  InnoDB: Initializing buffer pool, size = 8.0M
Dec 11 20:26:02 ubuntu mysqld[11291]: 111211 20:26:02  InnoDB: Completed initialization of buffer pool
Dec 11 20:26:02 ubuntu mysqld[11291]: 111211 20:26:02  InnoDB: Started; log sequence number 0 145554
Dec 11 20:26:02 ubuntu mysqld[11291]: 111211 20:26:02  InnoDB: Starting shutdown...
Dec 11 20:26:08 ubuntu mysqld[11291]: 111211 20:26:08  InnoDB: Shutdown completed; log sequence number 0 145554
Dec 11 20:26:08 ubuntu mysqld[11306]: 111211 20:26:08 [Note] Plugin 'FEDERATED' is disabled.
Dec 11 20:26:08 ubuntu mysqld[11306]: 111211 20:26:08  InnoDB: Initializing buffer pool, size = 8.0M
Dec 11 20:26:08 ubuntu mysqld[11306]: 111211 20:26:08  InnoDB: Completed initialization of buffer pool
Dec 11 20:26:08 ubuntu mysqld[11306]: 111211 20:26:08  InnoDB: Started; log sequence number 0 145554
Dec 11 20:26:08 ubuntu mysqld[11306]: ERROR: 1050  Table 'plugin' already exists
Dec 11 20:26:08 ubuntu mysqld[11306]: 111211 20:26:08 [ERROR] Aborting
Dec 11 20:26:08 ubuntu mysqld[11306]: 
Dec 11 20:26:08 ubuntu mysqld[11306]: 111211 20:26:08  InnoDB: Starting shutdown...
Dec 11 20:26:13 ubuntu mysqld[11306]: 111211 20:26:13  InnoDB: Shutdown completed; log sequence number 0 145554
Dec 11 20:26:13 ubuntu mysqld[11306]: 111211 20:26:13 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 11 20:26:13 ubuntu mysqld[11306]:

让我知道如何解决这个问题。

答案1

sudo apt-get remove mysql-server-5.1
sudo apt-get purge mysql-common
sudo apt-get purge mysql-server-5.1
sudo apt-get autoremove
sudo apt-get clean
  1. 首先安装mysql-common

    sudo apt-get install mysql-common
    
  2. 安装 mysql 的其余部分

    sudo apt-get install mysql-server
    

摘自 Ubuntu 论坛这里

请让我知道这可不可以帮你!

答案2

按照上述步骤,我得到了同样的错误。当我再次尝试时,我按照以下步骤操作,它成功了。请注意,唯一的区别是我mysql-server-5.1之前安装过mysql-server

sudo apt-get remove mysql-server-5.1
sudo apt-get purge mysql-common
sudo apt-get purge mysql-server-5.1
sudo apt-get autoremove
sudo apt-get clean

mysql-common首先安装

sudo apt-get install mysql-common

mysql-server-5.1下一步安装

sudo apt-get install mysql-server-5.1

安装 mysql 的其余部分

sudo apt-get install mysql-server

相关内容