I am needing to upgrade MySQL on Ubuntu, it is a production server and naturally cautious.

My many googles look to be essentially saying that I need to :

  1. Backup my current mysql database and tables/data

  2. Uninstall current mysql

  3. Install new MYSQL 5+

  4. Restore Databases/ tables and data

  5. Hope and Pray I got it right ??

Something doesn't seem right, sounds like a lot of down time and risk

Am I missing something, or any simple solutions?

Upgrading from MySQL 4 to 5 on Ubuntu 10

Many Thanks,


  • what's the problem? if you have backups then there is no risk factor. How big is the database?
    – Flukey
    Commented Jun 9, 2012 at 10:30
  • Sound like your assumptions are correct. As long as you have proper backups, you should be good to go.
    – rai
    Commented Jun 9, 2012 at 10:34
  • risk factor is my limited DBA knowledge on the setup side. I make regular sql dumps as backups and the box itself is backed up regularly. Not a huge database so file size is no problem. Just need a sanity check that those steps are the only way ?
    – Rob Sedge
    Commented Jun 9, 2012 at 10:34
  • I don't think praying will be of any help. Commented Jun 22, 2012 at 7:46

2 Answers 2


The upgrade process depends on how you installed your mysql distribution.

If you installed the ubuntu mysql distribution you don't need to upgrade that way (but always create the backup copy of all your dbs!). You need to upgrade that way only if you installed the mysql.com mysql distribution (ex. tar.gz).

If you installed mysql packages distributed by ubuntu (you can check it running dpkg -l | grep -i mysql-server) you may just need to use the ubuntu package manager to upgrade mysql.


The upgrade of the server itself should be a piece of cake, even for the casual admin.


There are many, many changes between 4.x and 5.x. I would not expect to be able to import a v4-dump into a v5-server straight out-of-the-box.

Be prepared for a strong head ache during data migration. Also, prepare your devs for significant (I'm tempted to write "massive") reworks on their applications. Some features have gone. Some features have changed.

Be sure to read the Changelog carefully before engaging the procedure ! Read ALL pages related to ALL versions between your current and your actual target version. Also, follow the link "Upgrading from MySQL 4.1 to 5.0", found at the bottom of the Changelog page (sorry, not enough rep' to post more than two hyperlinks :( )

Tip : it is possible to run multiple instances/versions of MySQL on the same system, in case you don't have a spare server at hand to play with.

  • Thanks Yak! The idea of running multiple appeals. Sounds a much kinder migration , meaning I can decommission the old once up and running .. still looking into the options here. Fab info, cheers.
    – Rob Sedge
    Commented Jun 9, 2012 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.