Mysql

無法安裝 MySQL

  • February 7, 2011

我想我知道我在 Unix shell 中在做什麼,但也許不知道。

我在 MySQL 的配置文件中犯了一個錯誤,所以我決定解除安裝它然後重新安裝它,所以我這樣做了:

sudo apt-get --purge remove mysql-server mysql-server-5.0 mysql-client

文件被刪除了,所以我然後嘗試安裝它,但它沒有要求我輸入root密碼或其他任何東西,所以我再次使用上述命令將其解除安裝然後做了

sudo rm -rf /etc/mysql
sudo rm /etc/init.d/mysql
sudo rm -rf /var/lib/mysql*

然後我重新啟動電腦,然後再次安裝它:

sudo apt-get install mysql-server mysql-client

它要求輸入 root 密碼,一切看起來都可以,直到我看到這個:

$ sudo apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree  

Reading state information... Done
The following extra packages will be installed:
 mysql-server-5.0
Suggested packages:
 tinyca
The following NEW packages will be installed:
 mysql-client mysql-server mysql-server-5.0
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 0B/27.4MB of archives.
After this operation, 86.7MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
 mysql-server-5.0 mysql-client mysql-server
Authentication warning overridden.
Preconfiguring packages ...
Can't exec "/tmp/mysql-server-5.0.config.28101": Permission denied at /usr/share/perl/5.10/IPC/Open3.pm line 168.
open2: exec of /tmp/mysql-server-5.0.config.28101 configure  failed at /usr/share/perl5/Debconf/ConfModule.pm line 59
mysql-server-5.0 failed to preconfigure, with exit status 255
Selecting previously deselected package mysql-server-5.0.
(Reading database ... 160284 files and directories currently installed.)
Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.0.51a-24+lenny5_amd64.deb) ...
Selecting previously deselected package mysql-client.
Unpacking mysql-client (from .../mysql-client_5.0.51a-24+lenny5_all.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.0.51a-24+lenny5_all.deb) ...
Processing triggers for man-db ...
Setting up mysql-server-5.0 (5.0.51a-24+lenny5) ...
Stopping MySQL database server: mysqld.
/var/lib/dpkg/info/mysql-server-5.0.postinst: line 144: /etc/mysql/conf.d/old_passwords.cnf: No such file or directory
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script returned error exit status 1
Setting up mysql-client (5.0.51a-24+lenny5) ...
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.0; however:
 Package mysql-server-5.0 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

現在我似乎無法弄清楚該怎麼做。我現在只想獲得一個乾淨的 MySQL 安裝。我正在執行 Debian 的最新穩定版本。

感謝所有幫助 - 謝謝!

編輯:我看了這個類似的問題,這表明我解除安裝了 mysql-common,但是當我嘗試這樣做時,我看到:

The following packages will be REMOVED:
 apache2 apache2-mpm-prefork apache2-utils apache2.2-common git-svn libapache2-mod-php5 libapache2-mod-python libapache2-svn libaprutil1
 libdbd-mysql-perl libdbd-mysql-rubygem libmysql-ruby libmysql-ruby1.8 libmysql-rubygem libmysqlclient15-dev libmysqlclient15off librdf-perl librdf0
 libserf-0-0 libsvn-perl libsvn1 mysql-client-5.0 mysql-common mytop ndn-apache22-php5 ndn-apache22-svn ndn-interpreters ndn-lighttpd
 ndn-netsaint-plugins ndn-perl-modules ndn-php5-cgi ndn-php5-xcache ndn-php53 ndn-php53-suhosin ndn-rubygems php5 php5-mcrypt php5-mysql proftpd
 proftpd-mod-mysql python-django python-mysqldb python-subversion python-svn subversion subversion-tools trac zendoptimizer
0 upgraded, 0 newly installed, 48 to remove and 1 not upgraded.

哎呀!有什麼建議麼?

dpkg 無法執行配置腳本。這是 Linux-VServer 問題。

使用 exec 選項重新掛載 /tmp。

引用自:https://serverfault.com/questions/231972