3

Well the first part of my day was spent researching how to remove MySQL to install MariaDB and the second part of my day was spent trying to reinstall MySQL cause something was messed up. So now I come to the masses for some help.

I have a box with cPanel/WHM on it. CentOS 5.6 64 bit. I have upgraded (through WHM) MySQL to 5.5.24 and that was successful. After some research, the options I found were an intimidating Linux command with pipes greps and dashes, and another command

yum remove mysql

I tried that out and it appeared to remove mysql.....ish. I tried installing MariaDB from this instructions page and it started to do it's thing and then came the zillions of errors (here's a small sample):

Transaction Check Error:
  file /etc/init.d/mysql from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysql_convert_table_format from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysql_install_db from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysql_secure_installation from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqlbug from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqld_multi from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqld_safe from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqldumpslow from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqlhotcopy from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/innochecksum.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/my_print_defaults.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/myisam_ftdump.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/myisamchk.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/myisamlog.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64

So it appeared that MySQL wasn't removed correctly. I've read from different tutorials given on different sites that to install MariaDB, you had to uninstall/remove MySQL and there weren't any commands given on how to do this.

Does anyone know how to "safely" remove MySQL on a WHM/cPanel server so that I can install MariaDB?

Here's my repo file in case anyone needs to know...

# MariaDB repository list - created 2012-07-10 17:09 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos5-x86
gpgcheck=1
n0nag0n
  • 163
  • 1
  • 8

2 Answers2

3

Apart from the package conflict:

You are installing a 32-bit DB engine on a 64-bit host. That is what the "x86" means in the repo line:

baseurl = http://yum.mariadb.org/5.5/centos5-x86

You are well-advised to replace this with

baseurl = http://yum.mariadb.org/5.5/centos5-amd64
Joel E Salas
  • 5,572
  • 16
  • 25
  • 1
    Well thank you for pointing out the fact that I need to update my contacts prescription..... Doh! – n0nag0n Jul 12 '12 at 19:50
2

You should remove the MySQL server first (you removed only the client so far), yum remove MySQL-server-5.5.24-1.cp.1132.x86_64 will do the trick. MariaDB should install w/o errors after that. And I think it's better to backup everything first. You should backup /var/lib/mysql at least.

Alex
  • 7,939
  • 6
  • 38
  • 52
  • How would I backup that folder properly? `cp /var/lib/mysql/ /var/lib/mysqlcopy/` ? And would I also do `yum remove mysql` after I remove the server? – n0nag0n Jul 10 '12 at 20:22
  • Yes that will work but you should stop the MySQL server first. Please check the process list to ensure `mysqld` is not running. – Alex Jul 10 '12 at 20:24
  • Worked like a charm. Although I had to get the full name of the MySQL Client version that popped up. – n0nag0n Jul 10 '12 at 21:35