我正在尝试安装 mysql-server 包,但是出现以下错误消息:
/home/nikitasorokin# apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version.
The following packages were automatically installed and are no longer required:
libaio1 ndn-mysql5-helper
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.5 (5.5.46-0ubuntu0.12.04.2) ...151108 11:54:25 [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.
151108 11:54:25 [Note] /usr/sbin/mysqld (mysqld 5.5.46-0ubuntu0.12.04.2) starting as process 14876 ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package 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 package 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)
apt-cache - 缓存
/home/nikitasorokin# apt-cache policy mysql-server-5.5
mysql-server-5.5:
Installed: 5.5.46-0ubuntu0.12.04.2
Candidate: 5.5.46-0ubuntu0.12.04.2
Version table:
*** 5.5.46-0ubuntu0.12.04.2 0
500 http://mirror.newdream.net/ubuntu/ precise-updates/main amd64 Packages
500 http://mirror.newdream.net/ubuntu/ precise-security/main amd64 Packages
100 /var/lib/dpkg/status
5.5.22-0ubuntu1 0
500 http://mirror.newdream.net/ubuntu/ precise/main amd64 Packages
提前致谢!
答案1
这里在 Ubuntu 12.04 中安装 mysql 的分步过程。OP 给出了存储库。以下是如何添加该存储库
sudo add-apt-repository 'deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu precise main'
该问题被标记为已解决,因此我认为这是一个成功的解决方案。
答案2
首先向后退一步并清除系统发现的任何部分安装。
sudo apt-get remove --purge mysql-server
然后尝试删除所有损坏的配置文件。
sudo apt-get autoremove
现在你重新开始了。你不必添加存储库。只需尝试
sudo apt-get install msyql-server
事实上,我很确定 MySql 服务器和客户端都可以从 Precise 的软件中心获得。