当我从 14.10 升级到 15.04 时,我的 mysql 不知为何坏了。
当我跑步时
sudo dpkg --configure -a
经过漫长的等待,我得到了以下回复
Setting up mysql-server-5.6 (5.6.24-0ubuntu2) ...
Job for mysql.service failed. See "systemctl status mysql.service" and "journalctl -xe" for details.
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
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.6; however:
Package mysql-server-5.6 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.6
mysql-server
谁能告诉我如何解决这个问题?
非常感谢。
答案1
好的,在@kos 和 google 的大力帮助下,我终于解决了这个问题。
似乎有效的步骤如下。
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
然后我就跑了
tasksel
并勾选了灯选项。不知为何,这个角度起作用了。虽然我无法告诉你原因。
答案2
一种方法是删除MySQL
并重新安装它:
sudo apt-get purge mysql
sudo apt-get install mysql
如果你愿意,你可以先备份所有内容:
/usr/sbin/service mysql stop
cp -rf /var/lib/mysql/* "~/BACKUPS/MySQL/"
/usr/sbin/service mysql start