MySQL 5.6 dpkg 安装错误,即使完全卸载后也是如此

MySQL 5.6 dpkg 安装错误,即使完全卸载后也是如此

从下载的 deb 和 apt 安装 MySQL 5.6 时遇到错误:

nginx@LBNginx:/tmp$ sudo dpkg -i mysql-server-5.6_5.6.27-0ubuntu0.14.04.1_amd64.deb
(Reading database ... 121037 files and directories currently installed.)
Preparing to unpack mysql-server-5.6_5.6.27-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-5.6 (5.6.27-0ubuntu0.14.04.1) over (5.6.27-0ubuntu0.14.04.1) ...
Setting up mysql-server-5.6 (5.6.27-0ubuntu0.14.04.1) ...
2015-10-27 19:31:17 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-10-27 19:31:17 0 [Note] /usr/sbin/mysqld (mysqld 5.6.27-0ubuntu0.14.04.1) starting as process 7666 ...
2015-10-27 19:31:17 7666 [Note] Plugin 'FEDERATED' is disabled.
2015-10-27 19:31:17 7666 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-27 19:31:17 7666 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-27 19:31:17 7666 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-27 19:31:17 7666 [Note] InnoDB: Memory barrier is not used
2015-10-27 19:31:17 7666 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-10-27 19:31:17 7666 [Note] InnoDB: Using Linux native AIO
2015-10-27 19:31:17 7666 [Note] InnoDB: Not using CPU crc32 instructions
2015-10-27 19:31:17 7666 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-27 19:31:17 7666 [Note] InnoDB: Completed initialization of buffer pool
2015-10-27 19:31:17 7666 [Note] InnoDB: Highest supported file format is Barracuda.
2015-10-27 19:31:17 7666 [Note] InnoDB: 128 rollback segment(s) are active.
2015-10-27 19:31:17 7666 [Note] InnoDB: Waiting for purge to start
2015-10-27 19:31:17 7666 [Note] InnoDB: 5.6.27 started; log sequence number 1626007
2015-10-27 19:31:17 7666 [Note] Binlog end
2015-10-27 19:31:17 7666 [Note] InnoDB: FTS optimize thread exiting.
2015-10-27 19:31:17 7666 [Note] InnoDB: Starting shutdown...
2015-10-27 19:31:19 7666 [Note] InnoDB: Shutdown completed; log sequence number 1626017
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--install):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 mysql-server-5.6

我已经从系统中完全删除了 MySQL 并再次尝试,但仍然无济于事。

注意:我正在运行 Ubuntu Server Trusty

答案1

首先mysql-server使用命令完全删除:

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

然后尝试再次安装。

sudo apt-get install mysql-server

如果您使用 dpkg 命令安装并且它显示对其他包的任何依赖,则运行命令:

sudo apt-get install -f 

然后再次尝试安装

编辑: 这里有 bug,mysql-server-5.6所以尝试较低版本的mysql-server。如果你想安装,mysql-server-5.6那么你可以使用电力价格协议。

在以下位置创建任何文件/etc/apt/sources.list.d/

sudo vi /etc/apt/sources.list.d/mysql.list

并粘贴以下行并保存。

deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu trusty main 
deb-src http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu trusty main 

并更新它

sudo apt-get update 

然后使用命令安装

sudo apt-get install mysql-server-5.6

它已在 上进行测试Ubuntu 14.04这里PPA 是否适用于Ubuntu版本12.04、、、和。14.0414.1015.0415.10

答案2

当我关注以下内容时我遇到了同样的问题教程在 ubuntu 14 上安装 mysql 5.6。

我使用 vagrant 安装了 Ubuntu。我只为虚拟机分配了 512 MB。

为了解决这个问题,我做了以下事情。

1)将虚拟机内存增加到1024MB

config.vm.provider "virtualbox" do |vb| # # Display the VirtualBox GUI when booting the machine # vb.gui = true # # # Customize the amount of memory on the VM: vb.memory = "1024" end

2)运行vagrant reload命令

3)然后卸载MySql

sudo apt-get remove mysql-server mysql-client
sudo apt-get install mysql-server-5.6 mysql-client-5.6

4)然后再次安装MySql并且它对我起作用了。

答案3

似乎是 mysql-common 的问题,您需要对 mysql-server-5.6_5.6.27 使用 mysql-common 5.5.46-0ubuntu0.14.04.2

执行后

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

尝试一下https://gist.github.com/dranes/e65bbaa8c7800fd12575

答案4

最后这对我有用

sudo apt-get install -f mysql-server

我补充道-F在命令中,在完全删除 mysql 之后。成功了!

相关内容