1

I changed my.cnv and nobody can connect to mysql again. So I decided to reinstall mysql.

I did

sudo aptitude purge mysql-server

followed by

sudo aptitude install mysql-server

then I got this log:

root@ip-10-134-10-182:~# sudo aptitude purge mysql-server
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Then when I do

sudo aptitude install mysql-server

I am stuck in a line. Looks like I need to fully uninstall mysql first before continuing. How.

Then I finally do

root@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 ... 27052 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) ...
120807  6:58:36 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
120807  6:58:36 [Note] Plugin 'FEDERATED' is disabled.
120807  6:58:36  InnoDB: Initializing buffer pool, size = 8.0M
120807  6:58:36  InnoDB: Completed initialization of buffer pool
120807  6:58:36  InnoDB: Started; log sequence number 2 4115700857
/usr/sbin/mysqld: File './mysql-bin.000005' not found (Errcode: 13)
120807  6:58:36 [ERROR] Failed to open log (file './mysql-bin.000005', errno 13)
120807  6:58:36 [ERROR] Could not open log file
120807  6:58:36 [ERROR] Can't init tc log
120807  6:58:36 [ERROR] Aborting

120807  6:58:36  InnoDB: Starting shutdown...
120807  6:58:42  InnoDB: Shutdown completed; log sequence number 2 4115700857
120807  6:58:42 [Note] /usr/sbin/mysqld: Shutdown complete

And after that it's just stuck there.

2 Answers 2

3

To remove mysql-server use: sudo aptitude remove mysql-server

if you just want to reinstall use: sudo aptitude reinstall mysql-server

4
  • I want to reinstall. Do I need to remove first?
    – user4951
    Aug 7, 2012 at 7:27
  • 1
    You should be able to just call the aptitude reinstall command. If that fails, remove it and start all over.
    – Kao
    Aug 7, 2012 at 7:29
  • I haven't got this problem at the moment but there have been several times in the past where I've wanted to reset a package and not known how to properly , resulting in one or two binned VMs, I'm going to remember this one!
    – Alex Berry
    Aug 7, 2012 at 7:29
  • Ya well.... I keep getting this lock that lock this bin that bin doesn't work and then hang.
    – user4951
    Aug 7, 2012 at 7:50
3
120807  6:58:36  InnoDB: Started; log sequence number 2 4115700857
/usr/sbin/mysqld: File './mysql-bin.000005' not found (Errcode: 13)
120807  6:58:36 [ERROR] Failed to open log (file './mysql-bin.000005', errno 13)
120807  6:58:36 [ERROR] Could not open log file

To know what does Error 13 mean:

# perror 13
OS error code  13:  Permission denied

So, it sounds like the above file is not owned by mysql user:

# chown -R mysql:mysql /path/to/data/dir

and try again.

2
  • Should I run as root?
    – user4951
    Aug 8, 2012 at 15:17
  • Yes, you need root to change owner to other user.
    – quanta
    Aug 8, 2012 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .