mysql kfreebsd debian ipv6-only

I love FreeBSD but I also love the ease of use that comes with an unobstrusive package management system like apt. I have a FreeBSD 9.1 host system running GNU/kFreeBSD Debian »Squeeze« instances using the jail(8) mechanism. It is an IPv6-only host without IPv4 connectivity at all – not even on its loopback interface. I will cover the installation procedure in a seperate article soon.

Squeeze comes with MySQL 5.1 which does not support IPv6: When setting the bind-address to ::1 in /etc/mysql/my.cnf, the server would not start. MySQL 5.5 introduces IPv6 but there are no ready-made binary packages. It could be as easy as adding a different source to /etc/apt/sources.list if it wasn't for our somewhat alien kfreebsd-amd64 (or -i386) build.

Adding Repos

Luckily, dotdeb.org not only has pre-built binaries for the more popular architecture but also the debian source packages. Following the instructions on how to add the dotdeb.org repository we quickly find out that their service is not yet available for the IPv6 internet. A bit of testing (using `dig aaaa <mirror hostname>` does the trick) made me add the following line to my sources.list:

deb-src http://ftp.hosteurope.de/mirror/packages.dotdeb.org/ squeeze all

Running apt-get update will get the indices from the new source while complaining about its unknown GPG key. See this article on how to import GPG keys into apt's keyring.

Unfortunately, we can't build yet: Building the 5.5 source requires debhelper >= 8.1.3 but Squeeze ships with 8.0.0 – debian-backports to the rescue! More lines to add to the /etc/apt/sources.list:

deb http://backports.debian.org/debian-backports squeeze-backports main
deb-src http://backports.debian.org/debian-backports squeeze-backports main

I'm glad debian.org is available via IPv6 – that cannot be said for most other geographically appropriate mirror sites.

Building and Installing

After introducing the system with the new sources through apt-get update we can now install the newer debhelper with the command apt-get -t debian-backports install debhelper. Building the source requires various build tools (duh…). I resolved the required dependencies by issuing the following install command:

apt-get install libncurses5-dev \
                libwrap0-dev \
                zlib1g-dev \
                libreadline-dev \
                chrpath \
                gawk \
                bison \
                lsb-release \
                hardening-wrapper \
                cmake

Finally, we've earned ourselves a cuppa coffee while waiting for apt-get -b source mysql-server-5.5 to complete. If it was successful you'll have several *.deb files in your current working directory. Assuming you've already removed the mysql-*-5.1 packages you may now install your own mysql-*-5.5 files locally:

  dpkg -i mysql-client-core-5.5_5.5.30-1~dotdeb.0_kfreebsd-amd64.deb \
          mysql-client-5.5_5.5.30-1~dotdeb.0_kfreebsd-amd64.deb \
          mysql-server-core-5.5_5.5.30-1~dotdeb.0_kfreebsd-amd64.deb \
          mysql-server-5.5_5.5.30-1~dotdeb.0_kfreebsd-amd64.deb

The post-install configuration (or to be more precise: starting mysqld) failed for me at first. Edit /etc/mysql/my.conf and change bind-address from 127.0.0.1 to ::1 and simply re-issue the dpkg -i … command.

comments powered by Disqus