嘗試在 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 配置其資料目錄的資訊。當您遇到錯誤或致命訊息行時,問題就開始了。如果您不清楚其含義,請發布文件的其餘部分。