I need to upgrade mysql 5.0 to mysql 5.1. Do i need to carry out anymore steps then these.

I will log into the server and do rpm -Uvh MySQL-server-community-5.1.63-1.rhel5.x86_64

the earlier version of mysql was installed using yum install .

Is this the correct approach ? After installing do i need to upgrade the indvidual database themselves if so how ?



As usual before such operations, back up your databases. You can use:

mysqldump --add-drop-database --all-databases

Your approach should be sufficient, but if not, you'll be able to restore everything in a clean way.

Edit: and you can refer to the MySQL documentation on the subject.

  • Can you please let me know sir what does the command mysqldump --add-drop-database --all-databases do ? And why is that your asking me to execute the command yes i have taken a backup of the database
    – jhon.smith
    Jul 7 '12 at 13:35
  • You can of course refer to its manpage. It outputs a long file that contains a dump of all databases in SQL. It will not drop databases, just include DROP commands in the dump, in case you restore. A common way to use it would be with something like mysqldump --add-drop-database --all-databases | gzip -1 > /var/lib/mysqldump.gz. Jul 7 '12 at 13:50

A backup is prudent, but it's not necessary to restore a full dump to upgrade between 5.0 and 5.1. Just run mysql_upgrade from the shell after you upgrade the binaries and restart MySQL.

Note you should read the MySQL manual on upgrading: Upgrading MySQL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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