我在 Ubuntu 12.04 上尝试安装 mysql-server 时收到以下错误
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:
python-libuser linux-headers-3.2.0-27 libqtwebkit4 python-central libuser1 linux-headers-3.2.0-27-generic-pae
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 125 not upgraded.
Need to get 0 B/8,737 kB of archives.
After this operation, 31.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
Selecting previously unselected package mysql-server-5.5.
(Reading database ... 312756 files and directories currently installed.)
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.29-0ubuntu0.12.04.2_i386.deb) ...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.5.29-0ubuntu0.12.04.2_all.deb) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db ...
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.04.2) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing 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 mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up 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)
答案1
在您的数据目录中(通常是 /var/lib/mysql)应该有一个文件 .err,您可以在其中找到更多详细信息。请查看该文件。首先,您将看到大量启动消息和有关 MySQL 配置其数据目录的信息。当您遇到错误或致命消息行时,问题就开始了。如果您不清楚其含义,请发布文件的其余部分。