MySQL 5.5 on Ubuntu 10.10

As we all know, MySQL 5.5 is the best thing since sliced bread (or, not exactly, but that’s what everyone will have you think), but unfortunately Ubuntu‘s latest and greatest server operating system – Ubuntu 10.10 Server comes with MySQL 5.1.

Even the next version of Ubuntu – 11.04 Natty Narwhal – doesn’t seem to deliver MySQL 5.5, so upgrading is not really an option as of yet. There is a bug report to deliver MySQL 5.5 for Natty, which is even marked as “in progress” but there’s no guarantee that it will happen.

So how to go about (ab)using the latest software from Oracle? One way is to build it yourself on your server, or convert the Oracle provided RPM packages using the alien tool – but its not really Ubuntu native and a mess (in both cases). Here is another approach:

We can instead install native Ubuntu packages for MySQL 5.5, based on the work in progress for the Ubuntu bug listed above, by using the source packages from Clint Byrum’s1 PPA and building them locally on your Ubuntu 10.10 server.

It looks that this build nicely, passes all the tests and installs cleanly on an Ubuntu 10.10 server without any hassles, so here is a simple walk through:

  1. Setup the PPA repository: go over to Clint Byrum’s PPA (by clicking on this link) and click on “Technical details about this PPA”. In the select box, choose “Lucid” – because the PPA no longer has Maverick packages, but the Lucid ones should work as well. Now in the box below that copy just the “deb-src” line and add it to the end of the /etc/apt/sources.list file on your Ubuntu 10.10 server. Don’t get the first “deb” line because that will add the binary repository and this can mess up your system when you do an upgrade later.
  2. Get the source package: create a new directory somewhere where you want to build the package and open a terminal and change to it, then run from the command line the command apt-get update and then apt-get source mysql-5.5.
  3. Install dependencies: in the sources that were downloaded into the directory you created in the above step, you’d find a directory called mysql-5.5-some-version, change into it and run dpkg-buildpackage. The command will run and then stop after complaining about missing dependencies. copy the names of all the dependencies (without the version information) and type apt-get install followed by the names of all the missing packages. Complete the installation and configuration of all the required packages.
  4. Build the new Ubuntu package: run dpkg-buildpackage again and watch it complete the build and tests. The build is pretty quick – I was very impressed, but the tests take forever and a half – be patient and equip yourself with a hot beverage and something to pass the time. Finally it will report that the new deb packages have been successfully built.
  5. Install the new software: go up one directory to the directory where you downloaded the source and install any package you need using the command dpkg -i followed by the file names of each deb package you require. When installing the mysql-server-core package you should get a configuration screen to set up the root password for the server, so don’t forget to set it to something that is useful.
  6. Last minute configuration: the mysql-5.5 packages built are designed for Natty (Ubuntu 11.04) and therefor have some Natty specific features. In order to get the MySQL server to start, we need to edit the file /etc/init/mysql and in the pre-start section comment out the apparmor line – this will not work in Ubuntu 10.10 and will cause the server to fail to load.
  7. Start the server: at this point we have only to start the server by issuing the “upstart” command start mysql.
Enhanced by Zemanta
  1. The guy who works on the 5.5 package for Natty []

21 Responses to “MySQL 5.5 on Ubuntu 10.10”

  1. Athalas:
    Fatal error: Uncaught Error: Call to undefined function comment_dir() in /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/single-comment2.php:17 Stack trace: #0 /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/functions.php(8): include() #1 /vhosts/coil/geek/public_html/wp-includes/class-walker-comment.php(179): themed_comment() #2 /vhosts/coil/geek/public_html/wp-includes/class-wp-walker.php(144): Walker_Comment->start_el() #3 /vhosts/coil/geek/public_html/wp-includes/class-walker-comment.php(139): Walker->display_element() #4 /vhosts/coil/geek/public_html/wp-includes/class-wp-walker.php(387): Walker_Comment->display_element() #5 /vhosts/coil/geek/public_html/wp-includes/comment-template.php(2229): Walker->paged_walk() #6 /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/comments.php(26): wp_list_comments() #7 /vhosts/coil/geek/public_html/wp-includes/comment-template.php(1539): require('/vhosts/coil/ge...') #8 /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/single.php( in /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/single-comment2.php on line 17