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:
- 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. - 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 thenapt-get source mysql-5.5
. - 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 rundpkg-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 typeapt-get install
followed by the names of all the missing packages. Complete the installation and configuration of all the required packages. - 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 newdeb
packages have been successfully built. - 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 eachdeb
package you require. When installing themysql-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. - 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 thepre-start
section comment out theapparmor
line – this will not work in Ubuntu 10.10 and will cause the server to fail to load. - Start the server: at this point we have only to start the server by issuing the “upstart” command
start mysql
.
Related articles
- What happened to MySQL? (coder2developer.wordpress.com)
- Getting started with MySQL on Ubuntu (curiousx.wordpress.com)
- Oracle Releases MySQL 5.5 (developers.slashdot.org)
- The guy who works on the 5.5 package for Natty [↩]
When I do apt-get source mysql-5.5 at the end of step 2, all I receive is:
E: Unable to find a source package for mysql-5.5
Please advice.
Thank you very much for the pointing out the problem with the apparmor line.
note you’ll be putting the “natty main” source into your sources.list file, not “maverick main”
and you might have to do apt-get install build-essential prior to running the apt-get source mysql-5.5
These were the missing dependencies to the build that I found missing
sudo apt-get install libtool
sudo apt-get install debhelper
sudo apt-get install libncurses5-dev
sudo apt-get install libwrap0-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libreadline-dev
sudo apt-get install po-debconf
sudo apt-get install chrpath
sudo apt-get install doxygen
sudo apt-get install texlive-latex-base
sudo apt-get install ghostscript
sudo apt-get install gawk
sudo apt-get install bison
sudo apt-get install hardening-wrapper
sudo apt-get install cmake
That could be changed into one like like so:
sudo apt-get install libtool debhelper libncurses5-dev libwrap0-dev zlib1g-dev libreadline-dev po-debconf chrpath doxygen texlive-latex-base ghostscript gawk bison hardening-wrapper cmake
Same problem as Athalas here. Shame as I hate installing stuff behind apt’s back.
You guys need to is in Step 1, choose “Maverick” in the “Choose your Ubuntu version” pull down in the list. I forgot to put that in, because if you access the PPA from your Ubuntu 10.10 desktop, it chooses it automatically. I’ll add it to the instructions.
It appears that the URL for the PPA has changed slightly – this should be the correct path now:
https://launchpad.net/~clint-fewbar/+archive/mysql
Thank you, I updated the link above.
Seems like there is nomore “Maverick” in the dropdown…
Thanks for noting this.
That is indeed a problem – it looks like the new PPA specifically does not deliver packages for maverick, though I’m not sure why: there are packages for Natty and for the older Lucid, but not for Maverick.
I’ve updated the post to instruct people to select Lucid, which I think should work, but I have not tested this procedure for a while and I’m currently lacking resources to do so. So if you guys have any comments on improving the process – I’ll do so with pleasure.
Hey i’m trying it now…but it keeps asking for a package called doxygen-latex (even if i have doxygen installed)…how to get around it? seems to be something from natty…
It indeed is something new from Natty. You should remove this requirement from debian meta-data files so it does not require it in the build. Otherwise you can build it also from source for 10.10.
I had one unit test failing and therefor couldn’t build the package…damn :-S
Ditto, the main.file_contents fails for me, so the build wont work.
I got a link with .deb packages for mysql 5.5.8…have installed them on Ubuntu 10.10 maverick. Works like charme…except the libmysql which i couldn’t handle to get installed.
Anyways libmysql 5.1 works with 5.5…so i’m happy for now.
http://people.debian.org/~nobse/mysql-5.5/
Thanks for submitting the URL here. I hope it helps more people 🙂
The tests can be dissabled in the CMakeLists.txt file, there’s a line:
OPTION (WITH_UNIT_TESTS “Compile MySQL with unit tests” ON)
change it to
OPTION (WITH_UNIT_TESTS “Compile MySQL with unit tests” OFF)
Needless to say, do it on your own risk.
[…] – חבל: לקצת זמן היה נראה שלי שהבלוג שלי אינו זוטה MySQL 5.5 on Ubuntu 10.10 [↩]VirtualBox on Ubuntu 11.04 […]
[…] from blog post/comments here. […]
This worked for me nicely..thanks
[…] I have written an article on how to install MySQL 5.5 on Ubuntu 10.10 using Ubuntu packages, I’m pretty sure it will work without any major issues on 10.04: http://geek.co.il/wp/2011/03/02/mysql-5-5-on-ubuntu-10-10 […]