无法在 Ubuntu 12.04 上安装 mysql 服务器

Posted

技术标签:

【中文标题】无法在 Ubuntu 12.04 上安装 mysql 服务器【英文标题】:Unable to install mysql server on Ubuntu 12.04 【发布时间】:2015-09-23 00:10:49 【问题描述】:

我在 Ubuntu 12.04 上安装 mysql 服务器没有成功。这是我在删除 --purge mysql 服务器后尝试安装时看到的内容:

$ sudo apt-get install mysql-server-5.5 mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  tinyca mailx
The following NEW packages will be installed:
  mysql-server mysql-server-5.5
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/8,861 kB of archives.
After this operation, 32.8 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package mysql-server-5.5.
(Reading database ... 257077 files and directories currently installed.)
Unpacking mysql-server-5.5 
    (from .../mysql-server-5.5_5.5.43-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.5.43-0ubuntu0.12.04.1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mysql-server-5.5 (5.5.43-0ubuntu0.12.04.1) ...
150705 15:38:03 [Warning] Using unique option prefix key_buffer instead of 
    key_buffer_size is deprecated and will be removed in a future release. 
    Please use the full name instead.
150705 15:38:03 [Note] /usr/sbin/mysqld (mysqld 5.5.43-0ubuntu0.12.04.1) 
    starting as process 14658 ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
No apport report written because the error message indicates its a followup 
    error from a previous failure.
            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
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

安装了一个 mysql 客户端,但是当我尝试启动它时,我得到了这个: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

任何帮助将不胜感激。

【问题讨论】:

askubuntu.com/questions/292865/upgrade-mysql-server-issue 【参考方案1】:

好吧,我没有从 StackExchange 得到任何帮助,所以我深入挖掘并自己弄清楚:首先,我按照Removing MySQL 5.5 Completely 的说明摆脱了 mysql-server 和 mysql-client。然后我像往常一样使用apt-get简单地安装了服务器和客户端。之后一切正常。

【讨论】:

以上是关于无法在 Ubuntu 12.04 上安装 mysql 服务器的主要内容,如果未能解决你的问题,请参考以下文章

无法在 ubuntu 12.04 上使用 mkl 构建 scipy

E:无法纠正问题,您在尝试在 Ubuntu 12.04 上安装 yaws 1.98 时持有损坏的软件包 [关闭]

Windows7和Ubuntu12.04无法选择系统

ubuntu 12.04下无法安装MySQL-python

如何在 Ubuntu 12.04 上读取崩溃文件?

xampp 无法在 ubuntu 12.04 中启动?