MySQL Uninstall Corruption
My socket file went missing from /var/run/mysqld/ directory so I thought
of reinstalling the whole thing. I did
apt-get remove --purge mysql-client mysql-client-5.5 mysql-client-core-5.5
mysql-servermysql-server-core-5.5 mysql-common
to remove all components. Then I did a apt-get install mysql-server. It
shows additional packages to be added. During installation the
mysql-server 5.5 confuguration dialog pops and asks for root password. I
tried adding my whole password (or even no password). but then the
configuration fails and it shows An error occurred while setting the
password for the MySQL administrative user. This may have happened because
the account already has a password, or because of a communication problem
with the MySQL server
followed by ,
130826 14:34:06 [Warning] Can't create test file
/var/lib/mysql/mypcname.lower-test
130826 14:34:06 [Warning] Can't create test file
/var/lib/mysql/mypcname.lower-test
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 its a
followup 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)
If I try apt-get install --reinstall it shows,
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 12 not
upgraded.
2 not fully installed or removed.
And then again the box pops up, asks for password and so on.
/var/log/mysql/error.log
130826 15:08:33 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
130826 15:08:33 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.
130826 15:08:33 InnoDB: The InnoDB memory heap is disabled
130826 15:08:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130826 15:08:33 InnoDB: Compressed tables use zlib 1.2.3.4
130826 15:08:33 InnoDB: Initializing buffer pool, size = 128.0M
130826 15:08:33 InnoDB: Completed initialization of buffer pool
130826 15:08:33 InnoDB: Operating system error number 13 in a file
operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
Following which i even did a chown mysql.mysql -R /var/lib/mysql/ but of
no use.
/varlog/syslog contents
Aug 26 14:15:13 mypcname kernel: [ 4825.238323] type=1400
audit(1377506713.644:344): apparmor="DENIED" operation="mknod"
parent=19649 profile="/usr/sbin/mysqld"
name="/home/var/lib/mysql/mypcname.lower-test" pid=19762 comm="mysqld"
requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Aug 26 14:15:13 mypcname mysqld_safe[19777]: 130826 14:15:13 [Warning]
Can't create test file /var/lib/mysql/mypcname.lower-test
Aug 26 14:15:13 mypcname mysqld_safe[19777]: 130826 14:15:13 [Warning]
Can't create test file /var/lib/mysql/mypcname.lower-test
Aug 26 14:15:13 mypcname mysqld_safe[19791]: 130826 14:15:13 [Warning]
Can't create test file /var/lib/mysql/mypcname.lower-test
Aug 26 14:15:13 mypcname mysqld_safe[19791]: 130826 14:15:13 [Warning]
Can't create test file /var/lib/mysql/mypcname.lower-test
Aug 26 14:15:15 mypcname kernel: [ 4827.460241] init: mysql main process
(19847) terminated with status 1
Aug 26 14:15:15 mypcname kernel: [ 4827.460270] init: mysql main process
ended, respawning
Aug 26 14:15:16 mypcname kernel: [ 4828.436900] init: mysql post-start
process (19848) terminated with status 1
Aug 26 14:15:16 mypcname kernel: [ 4828.496277] init: mysql main process
(19885) terminated with status 1
Aug 26 14:15:16 mypcname kernel: [ 4828.496305] init: mysql main process
ended, respawning
Aug 26 14:15:17 mypcname kernel: [ 4829.472938] init: mysql post-start
process (19886) terminated with status 1
Aug 26 14:15:17 mypcname kernel: [ 4829.538673] init: mysql main process
(19923) terminated with status 1
Aug 26 14:15:17 mypcname kernel: [ 4829.538700] init: mysql respawning too
fast, stopped