[mythtv-users] How to repair mysql?

Igor Cicimov icicimov at gmail.com
Mon Mar 11 01:00:01 UTC 2013


On Mon, Mar 11, 2013 at 10:04 AM, UB40D <ub40dd at googlemail.com> wrote:

> Thanks, this all sounds insightful. I hope we're getting close, though
> personally I still don't have much of a clue.
>
> On Sun, Mar 10, 2013 at 10:09 PM, Bill Meek <keemllib at gmail.com> wrote:
>
>> I appears to me that the script that's failing is:
>>
>>     /var/lib/dpkg/info/mysql-**server-5.5.postinst
>>
>
> I had a look inside that file
> http://pastebin.com/vVvUyjJT
> and the following error message caught my attention:
>
>
>    1. if you're reading this, it's most likely because you had replaced /
>    var/lib/mysql
>    2. with a symlink, then upgraded to a new version of mysql, and then
>    dpkg
>    3. removed your symlink (see #182747 and others).  the mysql packages
>    noticed
>    4. that this happened, and as a workaround have restored it.  however,
>    because
>    5. /var/lib/mysql seems to have been re-created in the meantime, and
>    because
>    6. we don't want to rm -rf something we don't know as much about, we're
>    going
>    7. to leave this unexpected directory here.  if your database looks
>    normal,
>    8. and this is not a symlink to your database, you should be able to
>    blow
>    9. this all away.
>
>
> Now, to be sure, I didn't replace /var/lib/mysql with a symlink, and I
> didn't upgrade to a NEW version of mysql, and I'm not aware of
> /var/lib/mysql ever having been a symlink; but perhaps what I did do
> (copying /var to another physical drive, deleting it and then changing
> /etc/fstab to point to the new /var) was equally upsetting to this poor
> script?
>
> And it's just as well it didn't rm -rf it because /var/lib/mysql/ (now
> /var/lib/mysql.bak/) is where mythconverg was. But not any more, now that
> I've moved the directory.
>
>
> Also when you did:
>>
>>
>> # ls -l /var/log/mysql
>> total 92
>> -rw-r----- 1 mysql adm 55463 Mar 10 17:33 error.log
>>
>> I looks like there's a lot of information in error.log,
>> so did you look (or can you pastebinit the log?)
>>
>
> It's here, http://pastebin.com/vi1g23vW , but it looks like it's merely a
> gazillion repetitions of the following stanza, which personally doesn't
> tell me much:
>
> 130310 17:33:42 [Note] Plugin 'FEDERATED' is disabled.
> 130310 17:33:42 InnoDB: The InnoDB memory heap is disabled
> 130310 17:33:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
> 130310 17:33:42 InnoDB: Compressed tables use zlib 1.2.7
> 130310 17:33:42 InnoDB: Using Linux native AIO
> 130310 17:33:43 InnoDB: Initializing buffer pool, size = 128.0M
> 130310 17:33:43 InnoDB: Completed initialization of buffer pool
> InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
> InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
> InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
> 130310 17:33:43 InnoDB: Could not open or create data files.
> 130310 17:33:43 InnoDB: If you tried to add new data files, and it failed
> here,
> 130310 17:33:43 InnoDB: you should now edit innodb_data_file_path in
> my.cnf back
> 130310 17:33:43 InnoDB: to what it was, and remove the new ibdata files
> InnoDB created
> 130310 17:33:43 InnoDB: in this failed attempt. InnoDB only wrote those
> files full of
> 130310 17:33:43 InnoDB: zeros, but did not yet use them in any way. But be
> careful: do not
> 130310 17:33:43 InnoDB: remove old data files which contain your precious
> data!
> 130310 17:33:43 [ERROR] Plugin 'InnoDB' init function returned error.
> 130310 17:33:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE
> failed.
> 130310 17:33:43 [ERROR] Unknown/unsupported storage engine: InnoDB
> 130310 17:33:43 [ERROR] Aborting
>
> 130310 17:33:43 [Note] /usr/sbin/mysqld: Shutdown complete
>
>
>
>> As to: # cat /etc/init.d/mysql, the actual script that
>> starts mysqld is: /etc/init/mysql.conf. The one in /etc/init.d
>> just 'points' to it.
>>
>
> And this one is here:
> http://pastebin.com/wmfeNY0b
>
>
>> Consider that the dpkg information is stored in the new filesystem
>> you just created. Did you copy the old /var there with something
>> that preserves timestamps, e.g. cp -aR?
>
>
> I seem to recall that I did. There are files in /var/backups with a date
> of before the copy---is that sufficient evidence?
>
>
>> It might be worth it to
>> attempt to remove some package you never use, just to see if this
>> is really mysql issue or a generic dpkg one (and then reinstall
>> the package.)
>
>
> How can I guess the name of a package that I never use (and more
> importantly that the system never uses, if it's not one I installed
> explicitly) and yet is on my system? Would it be ok if I first did
>  apt-get install somerubbish
> and then tried to remove it? Oh well, I tried that, and yes, I got an
> unexpected complaint about mysql---at some point it even asked me to
> configure the mysql password! So, good guess, I suppose; though it's
> slightly more involved: it's a generic dpkg issue BUT one which makes it
> always complain about mysql...
>
>
> # apt-get install gnome-mahjongg
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> gnome-mahjongg is already the newest version.
> 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
> 2 not fully installed or removed.
> After this operation, 0 B of additional disk space will be used.
> Do you want to continue [Y/n]? n
> Abort.
> # apt-get install mahjongg
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> mahjongg is already the newest version.
> 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
> 2 not fully installed or removed.
> After this operation, 0 B of additional disk space will be used.
> Do you want to continue [Y/n]?
> Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
> 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)
> #
>
>
> Thank you very much for your patience and perseverance with all this, Bill
> and everyone else! I'm really at the end of my guesses and your support is
> greatly appreciated!
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users
>
>
This is what I have on my 12.04

$ sudo dpkg -l "mysql*" | grep ii
ii  mysql-client
5.5.29-0ubuntu0.12.04.2                             MySQL database client
(metapackage depending on the latest version)
ii  mysql-client-5.5
5.5.29-0ubuntu0.12.04.2                             MySQL database client
binaries
ii  mysql-client-core-5.5
5.5.29-0ubuntu0.12.04.2                             MySQL database core
client binaries
ii  mysql-common
5.5.29-0ubuntu0.12.04.2                             MySQL database common
files, e.g. /etc/mysql/my.cnf
ii  mysql-server
5.5.29-0ubuntu0.12.04.2                             MySQL database server
(metapackage depending on the latest version)
ii  mysql-server-5.5
5.5.29-0ubuntu0.12.04.2                             MySQL database server
binaries and system database setup
ii  mysql-server-core-5.5
5.5.29-0ubuntu0.12.04.2                             MySQL database server
binaries

So start from the beginning, remove everything and clear the package cache.
I recommend start using aptitude (I've been using it for more than 3 years
now) instead of apt-get which is the recommended package manager by the
debian team. It has much better dependencies resolution and is more user
friendly than apt-get and I don't really understand why people still stick
with apt-get at all (probably because all the tutorials you can find on the
net are with old apt-get).

So if lets say I want to completely remove mysql from my system I would go
like this:

$ sudo su -
# dpkg -P mysql-client mysql-client-5.5 mysql-client-core-5.5 mysql-common
mysql-server mysql-server-5.5 mysql-server-core-5.5
# aptitude clean
# aptitude autoclean

Then confirm there hasn't been anything left over, if any of the bellow
directories exists then manually remove it:

/etc/mysql
/run/mysqld
/var/log/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/share/mysql
/usr/include/mysql
/usr/lib/mysql

# rm -rf /etc/mysql /var/lib/mysql /usr/lib/mysql ....... etc

!!!! RESTART !!!!

Install everything back:

$ sudo su -
# aptitude install mysql-client mysql-common mysql-server

The mysql-client and mysql-server are all you need (no version extensions)
since this mata packages are going to pull in the latest available release
of server and client from the repo.

Good luck.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130311/8e1561da/attachment.html>


More information about the mythtv-users mailing list