Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

First I clean up previous installation

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

So everything is clean

Then I restart the amazon EC

sudo aptitude install mysql-server

Two things usually happen

FIrst

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

and then hang there. Notice that it doesn't make sense that they complain about ./mysql.bin.index It's located at /var/lib/mysql and I already removed that.

Another thing that happen is no error at all but the whole thing just get stuck at setting mysql server and not moving forward.

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) ...

That's it. Nothing happen. It just stay there for a very long time.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Try following things

First remove everything

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

Install mysql-common first

sudo apt-get install mysql-common

Install the rest of mysql

sudo apt-get install mysql-server
share|improve this answer
    
You sure I should use sudo apt-get rather than sudo aptitude? –  Jim Thio Aug 9 '12 at 11:16
    
It seems to work. I can run mysql. –  Jim Thio Aug 9 '12 at 11:23
    
@JimThio When purging packages, use apt-get, aptitude is okay, but is facing deprecation because apt-get has caught up with it in terms of capabilities recently. –  Thomas W. Aug 9 '12 at 13:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.