Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to upgrade mysql from 5.0 to 5.5 on my local server. I have CentOS 5.8.

I have php5.3 installed. When I type

yum remove mysql mysql-*

The following comes out.

 mysql                x86_64       5.0.95-1.el5_7.1       installed       8.2 M
 mysql-server         x86_64       5.0.95-1.el5_7.1       installed        22 M
Removing for dependencies:
 perl-DBD-MySQL       x86_64       3.0007-2.el5           installed       328 k
 php53-mysql          x86_64       5.3.3-7.el5_8          installed       210 k

Q1. Should I type yes to remove all? If it is no, how to avoid removing php53-mysql? Do I need it?

Q2. After removing it, I am going to type the following. Is it correct.

yum install mysql55 mysql55-server --enablerepo=webtatic
service mysqld start

Thanks in advance.

share|improve this question
btw: why are you trying to upgrade to mysql5.5? Is there some new functionality that you need? – skarap May 22 '13 at 21:18

I'd suggest you use mysql 5.5 from IUS instead of webtatic. With it, you can also get yum-plugin-replace, which will let you do yum replace mysql --replace-with=mysql55 and it will figure out the dependencies and install the new package. This would avoid removing php53-mysql (which you need if you have any PHP code that interacts with MySQL).

share|improve this answer
And that's my "clever thing for today on SF", and it's not even 7am. Thank you! – MadHatter May 12 '12 at 5:27
My goodness, that yum-plugin-replace might prove to be a godsend for me. – qweet May 12 '12 at 20:54

Webtatic has added yum-plugin-replace to it's repository, and the guide is updated to allow upgrading via this method:

Assuming CentOS 5.x:

rpm -Uvh
yum install mysql.`uname -i` yum-plugin-replace
yum replace mysql --replace-with mysql55
share|improve this answer
this worked for me but I had to run rpm -e mysql.i386 --nodeps first – Ecropolis Jan 15 '15 at 14:30

A1 > Instead of doing yum remove. Do rpm -e on the package name, that would help retaining the dependencies

 rpm -e mysql-server. 

A2> Your second set of instructions look good. Since this is more of a fresh install, I think you MAY need to run the following steps instead of mysql_upgrade.

 Firstly, run mysql_install_db
 Secondly, run mysql_secure_installation
share|improve this answer
rpm -e package will produce an error if there are installed packages that have the package as a dependency. – jsbillings May 12 '12 at 2:41
rpm {-e|--erase} [--nodeps] PACKAGE_NAME – Chakri May 12 '12 at 19:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.