[mythtv-users] How to repair mysql?

UB40D ub40dd at googlemail.com
Sat Mar 16 16:38:35 UTC 2013


Sorry for taking a week to get back to these helpful suggestions---real job
including business trip.


On Mon, Mar 11, 2013 at 1:00 AM, Igor Cicimov <icicimov at gmail.com> wrote:

>
> This is what I have on my 12.04
>
> $ sudo dpkg -l "mysql*" | grep ii
>

I tried the same on mine:

# sudo dpkg -l "mysql*"
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version
Architecture          Description
+++-=================================-=====================-=====================-=======================================================================
un  mysql-client
<none>                                      (no description available)
un  mysql-client-4.1
<none>                                      (no description available)
un  mysql-client-5.0
<none>                                      (no description available)
un  mysql-client-5.1
<none>                                      (no description available)
ii  mysql-client-5.5                  5.5.29-0ubuntu0.12.10
amd64                 MySQL database client binaries
un  mysql-client-core-5.1
<none>                                      (no description available)
ii  mysql-client-core-5.5             5.5.29-0ubuntu0.12.10
amd64                 MySQL database core client binaries
ii  mysql-common                      5.5.29-0ubuntu0.12.10
all                   MySQL database common files, e.g. /etc/mysql/my.cnf
un  mysql-common-4.1
<none>                                      (no description available)
iU  mysql-server                      5.5.29-0ubuntu0.12.10
all                   MySQL database server (metapackage depending on the
latest version)
un  mysql-server-4.1
<none>                                      (no description available)
un  mysql-server-5.0
<none>                                      (no description available)
un  mysql-server-5.1
<none>                                      (no description available)
iF  mysql-server-5.5                  5.5.29-0ubuntu0.12.10
amd64                 MySQL database server binaries and system database
setup
un  mysql-server-core
<none>                                      (no description available)
un  mysql-server-core-5.0
<none>                                      (no description available)
un  mysql-server-core-5.1
<none>                                      (no description available)
ii  mysql-server-core-5.5             5.5.29-0ubuntu0.12.10
amd64                 MySQL database server binaries


So start from the beginning, remove everything and clear the package cache.
>

The point was, and still is, that I don't seem to be able to remove
everything. See below.


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

It's not the tutorials, it's ubuntu itself that tells you to use apt-get to
install programs whenever you type the name of one that isn't installed.
Example:

$ ffmpeg
The program 'ffmpeg' is currently not installed. You can install it by
typing:
sudo apt-get install ffmpeg

If they recommend a different one from the debian team, who am I to use
something else and then (in the usual pattern) get blamed if the
installation is inconsistent? ;-)
Anyway, willing to try aptitude, hoping it will solve the problem, but you
should take your case for aptitude to the ubuntu team rather than the users.



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
>

OK, done all that, still didn't clean up all the stuff. See below.



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

I have done more---looked for all the directories with a name starting with
mysql and moved them to .bak2 (except I didn't bother with the "doc" ones).
See below.



> !!!! RESTART !!!!
>

Did that too.
At this stage I rechecked and I still had leftover junk, though, so I
didn't proceed with reinstalling. In particular, the error messages seem to
indicate a dependency with mythtv (which needs mysql-client). OK, I know it
does, but can't I clean up and reinstall the damn mysql (which appears
broken) without having to nuke mythtv too? I feel that would be digging
myself into a deeper and deeper hole. It'll be bad enough having to restore
the database once mysql comes back up---I'd very much rather not have to do
that will all of mythtv, otherwise I might as well reinstall the lot from a
blank hard disk...


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

I can try that once I succeed in cleaning the system of mysql.


> Good luck.
>

Thanks, but it looks like I haven't got enough quite yet ;-)

Here was my attempt to remove all (as suggested, and based on the output of
dpkg-l) and its failed outcome.


#  dpkg -P mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server
mysql-server-5.5 mysql-server-core-5.5
dpkg: dependency problems prevent removal of mysql-client-5.5:
 mythtv-common depends on mysql-client; however:
  Package mysql-client is not installed.
  Package mysql-client-5.5 which provides mysql-client is to be removed.

dpkg: error processing mysql-client-5.5 (--purge):
 dependency problems - not removing
dpkg: dependency problems prevent removal of mysql-client-core-5.5:
 mysql-client-5.5 depends on mysql-client-core-5.5.

dpkg: error processing mysql-client-core-5.5 (--purge):
 dependency problems - not removing
dpkg: dependency problems prevent removal of mysql-common:
 mysql-client-5.5 depends on mysql-common (>= 5.5.29-0ubuntu0.12.10.1).
 libmysqlclient18:amd64 depends on mysql-common (>=
5.5.29-0ubuntu0.12.10.1).

dpkg: error processing mysql-common (--purge):
 dependency problems - not removing
(Reading database ... 322308 files and directories currently installed.)
Removing mysql-server ...
Removing mysql-server-5.5 ...
Purging configuration files for mysql-server-5.5 ...
dpkg: warning: while removing mysql-server-5.5, directory
'/usr/share/doc/mysql-server-5.5' not empty so not removed
dpkg: warning: while removing mysql-server-5.5, directory '/etc/mysql' not
empty so not removed
Removing mysql-server-core-5.5 ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Errors were encountered while processing:
 mysql-client-5.5
 mysql-client-core-5.5
 mysql-common

# aptitude clean

# aptitude autoclean

# for f in `echo /*/mysql* /*/*/mysql* /*/*/*/mysql*` ; do if [[ -d $f ]] ;
then echo $f ; fi ; done
/etc/mysql
/etc/mysql.bak
/run/mysqld
/run/mysqld.bak
/var/lib/mysql
/var/lib/mysql.bak
/var/log/mysql
/var/log/mysql.bak
/var/run/mysqld
/var/run/mysqld.bak
/lib/init/rw/mysqld
/lib/init/rw/mysqld.bak
/usr/share/doc/mysql-client-5.5
/usr/share/doc/mysql-client-core-5.5
/usr/share/doc/mysql-common
/usr/share/doc/mysql-server-5.5
/var/lib/mysql.bak/mysql
/var/lib/mysql/mysql


...then here I moved all the remaining mysql directories to .bak2 versions;
then rechecked...

# for f in `echo /*/mysql* /*/*/mysql* /*/*/*/mysql*` ; do if [[ -d $f ]] ;
then ls -ld $f ; fi ; done
drwxr-xr-x 3 root root 4096 Mar 10 20:45 /etc/mysql.bak
drwxr-xr-x 2 root root 4096 Mar 16 15:51 /etc/mysql.bak2
drwxr-xr-x 2 mysql root 40 Mar  8 20:16 /run/mysqld.bak
drwxr-xr-x 2 mysql root 40 Mar 10 20:56 /run/mysqld.bak2
drwx------ 6 mysql mysql 4096 Mar 10 17:33 /var/lib/mysql.bak
drwx------ 5 mysql mysql 4096 Mar 10 22:59 /var/lib/mysql.bak2
drwxr-s--- 2 mysql adm 4096 Mar 10 22:46 /var/log/mysql.bak
drwxr-s--- 2 mysql adm 4096 Mar 10 20:56 /var/log/mysql.bak2
drwxr-xr-x 2 mysql root 40 Mar  8 20:16 /var/run/mysqld.bak
drwxr-xr-x 2 mysql root 40 Mar 10 20:56 /var/run/mysqld.bak2
drwxr-xr-x 2 mysql root 40 Mar  8 20:16 /lib/init/rw/mysqld.bak
drwxr-xr-x 2 mysql root 40 Mar 10 20:56 /lib/init/rw/mysqld.bak2
drwxr-xr-x 2 root root 4096 Mar  3 14:49 /usr/share/doc/mysql-client-5.5
drwxr-xr-x 2 root root 4096 Jan 23 23:03
/usr/share/doc/mysql-client-core-5.5
drwxr-xr-x 2 root root 4096 Mar  3 14:49 /usr/share/doc/mysql-common
drwxr-xr-x 2 root root 4096 Mar 16 15:51 /usr/share/doc/mysql-server-5.5
drwx------ 2 mysql root 4096 Mar 10 22:59 /var/lib/mysql.bak2/mysql
drwx------ 2 mysql mysql 4096 Mar  3 13:23 /var/lib/mysql.bak/mysql

...OK, none left. And for good measure I rebooted and, with the system back
up, tried purging the packages again:

#  dpkg -P mysql-server-5.5 mysql-server mysql-client mysql-client-5.5
mysql-client-core-5.5 mysql-common
dpkg: warning: ignoring request to remove mysql-server-5.5 which isn't
installed
dpkg: warning: ignoring request to remove mysql-server which isn't installed
dpkg: warning: ignoring request to remove mysql-client which isn't installed
dpkg: dependency problems prevent removal of mysql-client-5.5:
 mythtv-common depends on mysql-client; however:
  Package mysql-client is not installed.
  Package mysql-client-5.5 which provides mysql-client is to be removed.

dpkg: error processing mysql-client-5.5 (--purge):
 dependency problems - not removing
dpkg: dependency problems prevent removal of mysql-client-core-5.5:
 mysql-client-5.5 depends on mysql-client-core-5.5.

dpkg: error processing mysql-client-core-5.5 (--purge):
 dependency problems - not removing
dpkg: dependency problems prevent removal of mysql-common:
 mysql-client-5.5 depends on mysql-common (>= 5.5.29-0ubuntu0.12.10.1).
 libmysqlclient18:amd64 depends on mysql-common (>=
5.5.29-0ubuntu0.12.10.1).

dpkg: error processing mysql-common (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 mysql-client-5.5
 mysql-client-core-5.5
 mysql-common


...there we go. Still not purged. Looks like I can't fully clean up the
system unless I also purge mythtv.
How can I reinstall and revive mysql without disturbing mythtv?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130316/b8e76a62/attachment.html>


More information about the mythtv-users mailing list