我正在使用 Ubuntu 14.04.3 LTS,我之前使用 MySQL 5.6.24 通过(https://launchpad.net/~ondrej/+archive/ubuntu/mysql-5.6),刚刚尝试更新它,但它死机了:
0 [Note] /usr/sbin/mysqld (mysqld 5.6.27-0ubuntu0.14.04.1) starting as process 3486 ...
3486 [Note] Plugin 'FEDERATED' is disabled.
3486 [Note] InnoDB: Using atomics to ref count buffer pool pages
3486 [Note] InnoDB: The InnoDB memory heap is disabled
3486 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
3486 [Note] InnoDB: Memory barrier is not used
3486 [Note] InnoDB: Compressed tables use zlib 1.2.8
3486 [Note] InnoDB: Using Linux native AIO
3486 [Note] InnoDB: Using CPU crc32 instructions
3486 [Note] InnoDB: Initializing buffer pool, size = 128.0M
3486 [Note] InnoDB: Completed initialization of buffer pool
3486 [Note] InnoDB: Highest supported file format is Barracuda.
3486 [Note] InnoDB: 128 rollback segment(s) are active.
3486 [Note] InnoDB: Waiting for purge to start
3486 [Note] InnoDB: 5.6.27 started; log sequence number 1059121176
3486 [Note] Binlog end
3486 [Note] InnoDB: FTS optimize thread exiting.
3486 [Note] InnoDB: Starting shutdown...
3486 [Note] InnoDB: Shutdown completed; log sequence number 1059121186
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
mysql-server-5.6
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经浏览过以下答案:
为什么在Ubuntu 14.04上安装MySQL 5.6会失败?
但我仍然无法弄清楚这到底是哪里出了问题,除了它可能与依赖关系有关。我试过:
dpkg -l | grep mysql
ii libdbd-mysql-perl 4.025-1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient18:amd64 5.6.25-3+deb.sury.org~trusty+1 amd64 MySQL database client library
ii mysql-client-5.6 5.6.27-0ubuntu0.14.04.1 amd64 MySQL database client binaries
ii mysql-client-core-5.6 5.6.27-0ubuntu0.14.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.6.25-3+deb.sury.org~trusty+1 all MySQL database common files, e.g. /etc/mysql/my.cnf
iF mysql-server-5.6 5.6.27-0ubuntu0.14.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.6 5.6.27-0ubuntu0.14.04.1 amd64 MySQL database server binaries
rc php5-mysqlnd 5.5.30+dfsg-1+deb.sury.org~trusty+1 amd64 MySQL module for php5 (Native Driver)
这表明 mysql-common 的版本号低于其余的版本号,但不确定这是否会造成很大的不同,因为在另一个系统上它虽然也存在,但是修订版本号高于其余的版本号,为 .24。
发现这表明它可能与 apparmor 有关(不知道这会影响事情)配置但我没有从 5.5 升级:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.6/+bug/1455773
我在这里看到的唯一其他选择是尝试更新到 5.7,看看是否会对我的问题有所改变。
任何关于如何解决这个问题的额外反馈或建议都将非常感谢,因为我真的不知道为什么现在会发生这种情况。
答案1
这里遇到的问题是,为 Ubuntu 提供 mysql 5.6 支持的 PPA 列出了 Ubuntu 存储库中可用的较新软件包。我猜想在 PPA 支持的版本和官方 Ubuntu 发行版之间切换会导致问题。
删除所有显示的软件包dpkg -l | grep mysql
并重新安装即可。如果您有超出标准软件包的软件包,请不要忘记保存已安装软件包列表 ;)