Ubuntu 14.10 64位
sudo apt-get purge mysql-server-5.5 mysql-common && sudo rm -r /etc/mysql
现在我们已经卸载了
sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
nginx-common nginx-core
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
mysql-server-5.5
Suggested packages:
tinyca
The following NEW packages will be installed:
mysql-server mysql-server-5.5
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/1763 kB of archives.
After this operation, 33.0 MB of additional disk space will be used.
Preconfiguring packages ...
Setting up mysql-server-5.5 (5.5.41-0ubuntu0.14.10.1) ...
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
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Nmap 显示该端口未被使用:
nmap localhost
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
631/tcp open ipp
5800/tcp open vnc-http
5900/tcp open vnc
30000/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
mysql 日志就是这样的。
sudo cat /var/log/mysql/error.log
150216 18:04:18 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
150216 18:04:18 [Note] Plugin 'FEDERATED' is disabled.
150216 18:04:18 InnoDB: The InnoDB memory heap is disabled
150216 18:04:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150216 18:04:18 InnoDB: Compressed tables use zlib 1.2.8
150216 18:04:18 InnoDB: Using Linux native AIO
150216 18:04:18 InnoDB: Initializing buffer pool, size = 128.0M
150216 18:04:18 InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
150216 18:04:18 InnoDB: Could not open or create data files.
150216 18:04:18 InnoDB: If you tried to add new data files, and it failed here,
150216 18:04:18 InnoDB: you should now edit innodb_data_file_path in my.cnf back
150216 18:04:18 InnoDB: to what it was, and remove the new ibdata files InnoDB created
150216 18:04:18 InnoDB: in this failed attempt. InnoDB only wrote those files full of
150216 18:04:18 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
150216 18:04:18 InnoDB: remove old data files which contain your precious data!
150216 18:04:18 [ERROR] Plugin 'InnoDB' init function returned error.
150216 18:04:18 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150216 18:04:18 [ERROR] Unknown/unsupported storage engine: InnoDB
150216 18:04:18 [ERROR] Aborting
150216 18:04:18 [Note] /usr/sbin/mysqld: Shutdown complete
我第一次运行tasksel
并安装 LAMP 服务器时,在安装过程中磁盘空间不足。很可能有关的。
答案1
既然您提到了这一点,建议您在 / 上至少留出 1GB 的可用空间才能拥有正常工作的系统,对于 mysql,请尝试以下操作:
sudo apt-get purge mysql-server mysql-server-5.5
sudo apt-get update
sudo apt-get install mysql-server
可能是你的 apt 缓存太旧了,它正在尝试拉取一些错误的包配置。我发现现在 mysql-server 是 mysql-server-5.6 的元包