首先我清理以前的安装
root@ip-10-134-10-182:~# rm -rf /var/lib/mysql
root@ip-10-134-10-182:~# rm -f /var/lib/dpkg/lock
root@ip-10-134-10-182:~# rm -f /var/cache/apt/archives/lock
root@ip-10-134-10-182:~# rm -f /var/lib/aptitude/lock
root@ip-10-134-10-182:~# rm -f /var/lib/apt/lists/lock
root@ip-10-134-10-182:~#
root@ip-10-134-10-182:~# sudo aptitude purge mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 38 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
所以一切都很干净
然后我重新启动亚马逊 EC
sudo aptitude 安装 mysql 服务器
通常会发生两件事
第一的
ubuntu@ip-10-134-10-182:~$ sudo aptitude install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following NEW packages will be installed:
libhtml-template-perl{a} mysql-server mysql-server-5.1{a} mysql-server-core-5.1{a}
0 packages upgraded, 4 newly installed, 0 to remove and 38 not upgraded.
Need to get 0B/12.2MB of archives. After unpacking 29.7MB will be used.
Do you want to continue? [Y/n/?] Y
Writing extended state information... Done
Preconfiguring packages ...
Selecting previously deselected package mysql-server-core-5.1.
(Reading database ... 28329 files and directories currently installed.)
Unpacking mysql-server-core-5.1 (from .../mysql-server-core-5.1_5.1.63-0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package mysql-server-5.1.
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.63-0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package libhtml-template-perl.
Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.9-1_all.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.1.63-0ubuntu0.10.04.1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mysql-server-core-5.1 (5.1.63-0ubuntu0.10.04.1) ...
Setting up mysql-server-5.1 (5.1.63-0ubuntu0.10.04.1) ...
120809 9:44:46 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
/usr/sbin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
120809 9:44:46 [ERROR] Aborting
120809 9:44:46 [Note] /usr/sbin/mysqld: Shutdown complete
然后就挂在那里了。请注意,他们抱怨 ./mysql.bin.index 是没有道理的,它位于 /var/lib/mysql 并且我已经将其删除了。
发生的另一件事是根本没有错误,但整个过程只是停留在设置 mysql 服务器上而没有继续前进。
root@ip-10-134-10-182:/var/lib# ls /var/lib/mysql -l
ls: cannot access /var/lib/mysql: No such file or directory
root@ip-10-134-10-182:/var/lib# sudo aptitude install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following NEW packages will be installed:
libhtml-template-perl{a} mysql-server mysql-server-5.1{a} mysql-server-core-5.1{a}
0 packages upgraded, 4 newly installed, 0 to remove and 38 not upgraded.
Need to get 0B/12.2MB of archives. After unpacking 29.7MB will be used.
Do you want to continue? [Y/n/?] Y
Writing extended state information... Done
Preconfiguring packages ...
Selecting previously deselected package mysql-server-core-5.1.
(Reading database ... 28329 files and directories currently installed.)
Unpacking mysql-server-core-5.1 (from .../mysql-server-core-5.1_5.1.63-0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package mysql-server-5.1.
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.63-0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package libhtml-template-perl.
Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.9-1_all.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.1.63-0ubuntu0.10.04.1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mysql-server-core-5.1 (5.1.63-0ubuntu0.10.04.1) ...
Setting up mysql-server-5.1 (5.1.63-0ubuntu0.10.04.1) ...
就是这样。什么也没发生。它只是在那里停留了很长时间。
答案1
尝试以下事情
首先删除所有内容
sudo apt-get remove mysql-server-5.1
sudo apt-get purge mysql-common
sudo apt-get purge mysql-server-5.1
sudo apt-get autoremove
sudo apt-get clean
首先安装mysql-common
sudo apt-get install mysql-common
安装 mysql 的其余部分
sudo apt-get install mysql-server