AKA: the story of how work's main database server got an unexpected
MySQL upgrade last night.


So I get fed up with mysql_setpermissions not working on our CentOS
database server.  "Time to get that fixed", I think.

Firstly, a quick recap of the error message; apparently it bombs out for
lack of the perl DBD::mysql modules.  "Easy!" I think, and try to
install it from CPAN, before remembering that this always fails due to
lack of the MySQL devel libs.  Hrm.  So, on to plan B, install those
libs or the perl module itself from RPM packages.

Secondly then, a quick look at what's already installed on the box:

[r...@d01-olg ~]# rpm -qa | grep -i mysql
MySQL-server-standard-5.0.21-1.rhel4
MySQL-client-standard-5.0.21-1.rhel4
MySQL-shared-standard-5.0.21-1.rhel4
[r...@d01-olg ~]# rpm -qa | grep -i perl
perl-Filter-1.30-6
perl-5.8.5-24.RHEL4
perl-DBI-1.40-8

Thirdly, a quick google for what's available.  Aha, perl-DBD-MySQL, just
the thing.  Now this is where it goes a bit wrong, so pay attention:

[r...@d01-olg ~]# up2date perl-DBD-MySQL

Fetching rpm headers...
########################################

Name                                    Version        Rel
----------------------------------------------------------
perl-DBD-MySQL                          2.9004         3.1

Testing package set / solving RPM inter-dependencies...

Downloading headers to solve dependencies...
########################################
perl-DBD-MySQL-2.9004-3.1.i ########################## Done.
mysql-4.1.20-1.RHEL4.1.i386 ########################## Done.
Preparing              ########################################### [100%]

Installing...
   1:mysql                  warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
########################################### [100%]
   2:perl-DBD-MySQL         ########################################### [100%]
The following packages were added to your selection to satisfy dependencies:

Name                                    Version        Release
--------------------------------------------------------------
mysql                                   4.1.20         1.RHEL4.1


Wait, what?  You did /what/?!

Fourth step then, would be to run in circles screaming and panicking.

Fifth, check that it just did what it looked like it just did:
[r...@d01-olg downloads]# rpm -qa | grep -i mysql
perl-DBD-MySQL-2.9004-3.1
MySQL-shared-standard-5.0.21-1.rhel4
mysql-4.1.20-1.RHEL4.1

It did.  To install the requested perl module, with no prompting
whatsoever it has downgraded the MySQL server from 5.0 to 4.1, and then
removed any MySQL client packages that didn't fit in with this master
plan.

Sixth, panic some more.  Intersperse with a lot of swearing.

Seventh, check the mysql data dir is still there:
[r...@d01-olg ~]# cd /var/lib/
[r...@d01-olg lib]# du -sh mysql/
13G     mysql/

It is.  Start breathing again.

Eighth, backup the mysql data dir before anything else happens:
[r...@d01-olg lib]# cp -a mysql/ mysql.20070306
[r...@d01-olg lib]#

Ninth, download the latest MySQL-5.0 packages from mysql.com:
[r...@d01-olg downloads]# ll
total 28632
-rw-r--r--  1 root root  6908341 Oct 26 20:06 
MySQL-client-standard-5.0.27-0.rhel4.i386.rpm
-rw-r--r--  1 root root  7110183 Oct 26 20:07 
MySQL-devel-standard-5.0.27-0.rhel4.i386.rpm
-rw-r--r--  1 root root 13561014 Oct 26 20:10 
MySQL-server-standard-5.0.27-0.rhel4.i386.rpm
-rw-r--r--  1 root root  1685652 Oct 26 20:11 
MySQL-shared-standard-5.0.27-0.rhel4.i386.rpm

Tenth, install them:
[r...@d01-olg downloads]# rpm -Uvh MySQL-*
warning: MySQL-client-standard-5.0.27-0.rhel4.i386.rpm: V3 DSA signature: 
NOKEY, key ID 5072e1f5
Preparing...                ########################################### [100%]
   1:MySQL-shared-standard  ########################################### [ 25%]
   2:MySQL-client-standard  ########################################### [ 50%]
   3:MySQL-devel-standard   ########################################### [ 75%]
   4:MySQL-server-standard  ########################################### [100%]


Eleventh, connect to the database and look for the data:
[r...@d01-olg downloads]# mysql -uroot -p
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 5.0.27-standard

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| client1            |
| client1_test       |
| client2            |
| client2_test       |
[...]

Twelfth, start breathing again (apparently stopped again somewhere
around step ten).


*head-desk*



Jesus fucking Christ, what the FUCKING fuck?  Call that package
management??



"Friends don't let friends run Red Hat.  Or cheap Red Hat clones."

Reply via email to