yum update/upgrade breaks Mysql with Percona-Server-shared and deletes my.cnf

Yesterday I wanted to perform and upgrade from Centos 6.0 to Centos 6.2. We have xtrabackup and ONLY xtrabackup installed.

I will first show you what happens when I run yum upgrade after I update the OS with Percona repo disabled. My initial problem was in the reverse order however, but this is shorter to explain:

“yum upgrade” from Centos 6.2:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • base: be.mirror.eurid.eu
  • extras: be.mirror.eurid.eu
  • rpmforge: apt.sw.be
  • updates: be.mirror.eurid.eu
    Setting up Upgrade Process
    Resolving Dependencies
    → Running transaction check
    —> Package Percona-Server-shared-51.x86_64 0:5.1.61-rel13.2.430.rhel6 will be obsoleting
    —> Package Percona-Server-shared-compat.x86_64 0:5.5.20-rel24.1.217.rhel6 will be obsoleting
    —> Package mysql-libs.x86_64 0:5.1.61-1.el6_2.1 will be obsoleted
    → Finished Dependency Resolution

Dependencies Resolved

============================================================ ====================
Package Arch Version Repository
Size
============================================================ ====================
Installing:
Percona-Server-shared-51 x86_64 5.1.61-rel13.2.430.rhel6 percona 2.8 M
replacing mysql-libs.x86_64 5.1.61-1.el6_2.1
Percona-Server-shared-compat x86_64 5.5.20-rel24.1.217.rhel6 percona 3.8 M
replacing mysql-libs.x86_64 5.1.61-1.el6_2.1

Transaction Summary
============================================================ ====================
Install 2 Package(s)

Total size: 6.6 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test

Transaction Check Error:
file /usr/lib64/libmysqlclient.so.16.0.0 conflicts between attempted installs of Percona-Server-shared-compat-5.5.20-rel24.1.217.rhel6.x86_64 and Percona-Server-shared-51-5.1.61-rel13.2.430.rhel6.x86_64
file /usr/lib64/libmysqlclient_r.so.16.0.0 conflicts between attempted installs of Percona-Server-shared-compat-5.5.20-rel24.1.217.rhel6.x86_64 and Percona-Server-shared-51-5.1.61-rel13.2.430.rhel6.x86_64

But from Centos 6.0 to Centos 6.2, there are no complaints. yum upgrade runs fine and replaces mysql-libs-5.1 with Percona-Server-shared-compat and Percona-Server-shared-51 and get installed properly:

rpm -qa |grep -i perc
Percona-Server-shared-compat-5.5.20-rel24.1.217.rhel6.x86_64
Percona-Server-shared-51-5.1.61-rel13.2.430.rhel6.x86_64

rpm -qa |grep -i xtra
xtrabackup-1.6.5-328.rhel6.x86_64

and then this happens afterwards:

mysql -u root -p
mysql: relocation error: mysql: symbol strmov, version libmysqlclient_16 not defined in file libmysqlclient.so.16 with link time reference

ls -l /etc/my.cnf
ls: cannot access /etc/my.cnf: No such file or directory

my.cnf is now renamed to /etc/my.cnf.rpmsave

Ok, renamed it back. Now start mysql again:

/etc/init.d/mysqld start
MySQL Daemon failed to start.
Starting mysqld:

This is what I get from /var/log/messages (nothing in /var/log/mysqld.log since upgrade)
Feb 14 13:54:06 awp57 mysqld_safe: Starting mysqld daemon with databases from /data/db
Feb 14 13:54:06 awp57 mysqld: 120214 13:54:06 [ERROR] Can’t find messagefile ‘/usr/share/mysql/english/errmsg.sys’
Feb 14 13:54:06 awp57 mysqld: 120214 13:54:06 InnoDB: Initializing buffer pool, size = 400.0M
Feb 14 13:54:06 awp57 mysqld: 120214 13:54:06 InnoDB: Completed initialization of buffer pool
Feb 14 13:54:06 awp57 mysqld: 120214 13:54:06 InnoDB: Started; log sequence number 10 3184356122
Feb 14 13:54:06 awp57 mysqld: 120214 13:54:06 [ERROR] Aborting
Feb 14 13:54:06 awp57 mysqld:
Feb 14 13:54:06 awp57 mysqld: 120214 13:54:06 InnoDB: Starting shutdown…
Feb 14 13:54:12 awp57 mysqld: 120214 13:54:12 InnoDB: Shutdown completed; log sequence number 10 3184356122
Feb 14 13:54:12 awp57 mysqld: 120214 13:54:12 [Note]
Feb 14 13:54:12 awp57 mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended

So now mysql client AND mysql server is broken.

When I disable the Percona.repo repository and upgrade then, I get a nice clean system.
I can enable the repo afterwards and run yum upgrade xtrabackup, which does NOT pull in Percona-Server-shared.
Judging from the filedate of/ usr/lib64/mysql/libmysqlclient.so.16.0.0 which is Feb 10 2012 and the date of my problem (Feb 13 2012) AND the fact that Google returns me nothing on this problem I can only conclude further this is an unknown bug.

workaround to fix your machine:

yum remove Percona-Server-shared-compat-5.5.20-rel24.1.217.rhel6.x86_64
rpm -e Percona-Server-shared-51-5.1.61-rel13.2.430.rhel6.x86_64 --nodeps

Yum refuses, RPM as well, but “–nodeps” forces it. You 'll fix it below but have to disable the Percona.repo first:

cd /etc/yum.repos.d/
mv Percona.repo Percona.repo.disabled
yum install mysql-libs

And then:

/etc/init.d/mysqld start

and try a login

mysql -u root -p

Enable the Percona.repo by renaming the extension to .repo anytime you need to upgrade xtrabackup

mv Percona.repo.disabled Percona.repo
yum upgrade xtrabackup

This is the problem causing MySQL not to start:

Can’t find messagefile ‘/usr/share/mysql/english/errmsg.sys’

It looks like your my.cnf file is missing the explicit option that tells mysqld where that file is.

Why this is happening, I am not sure. I would need to inspect the system to find out.