How to upgrade MySQL 4 to MySQL 5 on CentOS 4

I was playing a round with new software today which needed MySQL 5. My server’s running CentOS 4.6 which ships by default with MySQL 4.

The to upgrade to MySQL 5 from MySQL 4 is easy. There are 2 options you could use.

The first option would require you to remove all MySQL 4 packages by running,

># yum remove mysql

The seconf option is way simpler.

># yum --enablerepo=centosplus update mysql

This will download MySQL 5 from the plus repository and replace the installed MySQL 4.

Remeber to backup your DBs before updating.

4 Responses to “How to upgrade MySQL 4 to MySQL 5 on CentOS 4”

Author comments are in a darker gray color for you to easily identify the posts author in the comments

  1. Ian Scott says:

    The seconf option is way simpler.

    # yum –enablerepo=centosplus update mysql

    Interesting. I’ve tried this and I get a bunch of conflicts like this:

    Transaction Check Error: file /etc/my.cnf from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/README from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/cp1251.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/cp1256.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/cp1257.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/cp850.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/cp852.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/cp866.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/dec8.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/geostd8.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/greek.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/hebrew.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/hp8.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/koi8r.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/koi8u.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/latin1.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/latin2.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/latin5.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/latin7.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/macce.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/macroman.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/charsets/swe7.xml from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/bin/mysqldumpslow from install of mysql-server-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/bin/msql2mysql from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/bin/mysql_find_rows from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/bin/mysql_tableinfo from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/bin/mysqlaccess from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/info/mysql.info.gz from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/man/man1/mysql.1.gz from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/man/man1/mysqlaccess.1.gz from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/man/man1/mysqladmin.1.gz from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/man/man1/mysqldump.1.gz from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /usr/share/man/man1/mysqlshow.1.gz from install of mysql-5.0.68-1.el4_6 conflicts with file from package mysql-4.1.22-2.el4
    file /etc/php.ini from install of php-common-5.1.6-3.el4s1.10 conflicts with file from package php-4.3.9-3.22.12
    *************************

    You didn’t get any of that?

  2. Danesh says:

    looks like you might have to remove version for first…

  3. Ian Scott says:

    Actually, what I discovered was that there were two mysql packages installed on the server – one for i386, the other for my architecture, 64 bit.

    When I removed the i386 package, all but the php.ini warning disappeared.

    So I was able to upgrade mysql – and then removed php (and some dependencies), and then installed php using CentosPlus repository.

  4. BrazilianOpenSorce says:

    Thx works perfect!!

Leave a Reply

© 2008-2009 The Danesh Project
Powered by Wordpress and made by Guerrilla. Best viewed in Mozilla Firefox