Re-compiling MySQL 5.0 with OpenSSL support under Debian

If you’ve ever required OpenSSL support enabled for MySQL Server 5.0 under debian, then you will need to recompile MySQL. Under Debian this is very easy.

If you’ve ever required OpenSSL support enabled for MySQL Server 5.0 under debian, then you will need to recompile MySQL. Under Debian this is very easy.

First you will need to download the package source, as root type the following:

cd /root
mkdir build
cd build
apt-get source mysql-source-5.0

The above commands will create a folder called ‘build’, enter the directory and then download the mysql-server-5.0 package source. The following are the results under an Ubuntu server:

[[email protected]:/root/builds]# apt-get source mysql-server-5.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 16.8MB of source archives.
Get:1 feisty-security/main mysql-dfsg-5.0 5.0.38-0ubuntu1.1 (dsc) [1209B] Get:2 feisty-security/main mysql-dfsg-5.0 5.0.38-0ubuntu1.1 (tar) [16.6MB] Get:3 feisty-security/main mysql-dfsg-5.0 5.0.38-0ubuntu1.1 (diff) [149kB] Fetched 16.8MB in 17s (957kB/s)
dpkg-source: extracting mysql-dfsg-5.0 in mysql-dfsg-5.0-5.0.38
dpkg-source: unpacking mysql-dfsg-5.0_5.0.38.orig.tar.gz
dpkg-source: applying ./mysql-dfsg-5.0_5.0.38-0ubuntu1.1.diff.gz

If you list the directory contents you should have something like this:

[[email protected]:/root/builds]# ls -al
total 16408K
drwxr-xr-x 3 root root 4096 2007-10-30 13:08 ./
drwxr-xr-x 15 root root 4096 2007-10-30 13:06 ../
drwxr-xr-x 39 root root 4096 2007-10-30 13:08 mysql-dfsg-5.0-5.0.38/
-rw-r--r-- 1 root root 148883 2007-10-10 14:11 mysql-dfsg-5.0_5.0.38-0ubuntu1.1.diff.gz
-rw-r--r-- 1 root root 1209 2007-10-10 14:11 mysql-dfsg-5.0_5.0.38-0ubuntu1.1.dsc
-rw-r--r-- 1 root root 16602385 2007-04-03 05:03 mysql-dfsg-5.0_5.0.38.orig.tar.gz

Before we proceed we need to make sure that we have all of the necessary tools to compile the new packages and create the .deb:

apt-get install devscripts build-essential fakeroot

You will also want to make sure that you have any dependencies that the package would require:

apt-get build-dep mysql-server-5.0

Now that we have everything we need, we just need to make a modification to the file “mysql-dfsg-5.0-5.0.38/debian/rules” with your favorite editor. Search for the following lines within the file:


And change the lines to the below:


Basically you’re enabling OpenSSL and disabling YaSSL, make sure that you have OpenSSL installed (apt-get install openssl). Once you’ve finished editing the file, save it and exit out of the editor.

You will then want to start the compiling and build of the Debian packages, run the following command within the “mysql-dfsg-5.0-5.0.3” directory like so:

[[email protected]:/root/builds/mysql-dfsg-5.0-5.0.3]# debuild -us -uc

Everything should process properly, and you should end up with a handful of .deb packages within “/root/builds”:

[[email protected]:/root/builds]# ls -al
total 57628K
drwxr-xr-x 3 root root 4096 2007-10-30 14:02 ./
drwxr-xr-x 15 root root 4096 2007-10-30 14:35 ../
-rw-r--r-- 1 root root 6411178 2007-10-30 14:02 libmysqlclient15-dev_5.0.38-0ubuntu1.1_i386.deb
-rw-r--r-- 1 root root 1426470 2007-10-30 14:01 libmysqlclient15off_5.0.38-0ubuntu1.1_i386.deb
-rw-r--r-- 1 root root 45756 2007-10-30 14:01 mysql-client_5.0.38-0ubuntu1.1_all.deb
-rw-r--r-- 1 root root 6794738 2007-10-30 14:02 mysql-client-5.0_5.0.38-0ubuntu1.1_i386.deb
-rw-r--r-- 1 root root 54466 2007-10-30 14:01 mysql-common_5.0.38-0ubuntu1.1_all.deb
drwxr-xr-x 40 root root 4096 2007-10-30 14:00 mysql-dfsg-5.0-5.0.38/
-rw-r--r-- 1 root root 148883 2007-10-30 13:34 mysql-dfsg-5.0_5.0.38-0ubuntu1.1.diff.gz
-rw-r--r-- 1 root root 972 2007-10-30 13:34 mysql-dfsg-5.0_5.0.38-0ubuntu1.1.dsc
-rw-r--r-- 1 root root 1761484 2007-10-30 14:02
-rw-r--r-- 1 root root 3136 2007-10-30 14:02 mysql-dfsg-5.0_5.0.38-0ubuntu1.1_i386.changes
-rw-r--r-- 1 root root 16602385 2007-04-03 05:03 mysql-dfsg-5.0_5.0.38.orig.tar.gz
-rw-r--r-- 1 root root 47854 2007-10-30 14:02 mysql-server-4.1_5.0.38-0ubuntu1.1_i386.deb
-rw-r--r-- 1 root root 47828 2007-10-30 14:01 mysql-server_5.0.38-0ubuntu1.1_all.deb
-rw-r--r-- 1 root root 25522626 2007-10-30 14:02 mysql-server-5.0_5.0.38-0ubuntu1.1_i386.deb

Just run dpkg -i *.deb and all should be good!

[[email protected]:/root/builds]# dpkg -i *.deb
(Reading database ... 48209 files and directories currently installed.)
Preparing to replace libmysqlclient15-dev 5.0.38-0ubuntu1.1 (using libmysqlclient15-dev_5.0.38-0ubuntu1.1_i386.deb) ...
Unpacking replacement libmysqlclient15-dev ...
Preparing to replace libmysqlclient15off 5.0.38-0ubuntu1.1 (using libmysqlclient15off_5.0.38-0ubuntu1.1_i386.deb) ...
Unpacking replacement libmysqlclient15off ...
Preparing to replace mysql-client 5.0.38-0ubuntu1.1 (using mysql-client_5.0.38-0ubuntu1.1_all.deb) ...
Unpacking replacement mysql-client ...
Preparing to replace mysql-client-5.0 5.0.38-0ubuntu1.1 (using mysql-client-5.0_5.0.38-0ubuntu1.1_i386.deb) ...
Unpacking replacement mysql-client-5.0 ...
Preparing to replace mysql-common 5.0.38-0ubuntu1.1 (using mysql-common_5.0.38-0ubuntu1.1_all.deb) ...
Unpacking replacement mysql-common ...
Preparing to replace mysql-server-4.1 5.0.38-0ubuntu1.1 (using mysql-server-4.1_5.0.38-0ubuntu1.1_i386.deb) ...
* Stopping MySQL database server mysqld [ OK ] Unpacking replacement mysql-server-4.1 ...
Preparing to replace mysql-server 5.0.38-0ubuntu1.1 (using mysql-server_5.0.38-0ubuntu1.1_all.deb) ...
* Stopping MySQL database server mysqld [ OK ] Unpacking replacement mysql-server ...
Preparing to replace mysql-server-5.0 5.0.38-0ubuntu1.1 (using mysql-server-5.0_5.0.38-0ubuntu1.1_i386.deb) ...
* Stopping MySQL database server mysqld [ OK ] * Stopping MySQL database server mysqld [ OK ] Unpacking replacement mysql-server-5.0 ...
Setting up mysql-common (5.0.38-0ubuntu1.1) ...
Setting up libmysqlclient15off (5.0.38-0ubuntu1.1) ...
Setting up mysql-client-5.0 (5.0.38-0ubuntu1.1) ...
Setting up mysql-server-5.0 (5.0.38-0ubuntu1.1) ...
* Stopping MySQL database server mysqld [ OK ] * Starting MySQL database server mysqld [ OK ] * Checking for corrupt, not cleanly closed and upgrade needing tables.
Setting up libmysqlclient15-dev (5.0.38-0ubuntu1.1) ...
Setting up mysql-client (5.0.38-0ubuntu1.1) ...
Setting up mysql-server-4.1 (5.0.38-0ubuntu1.1) ...
Setting up mysql-server (5.0.38-0ubuntu1.1) ...

Did you like this article?

You May Also Like

Apple releases iPhone 2.0.2 Firmware/Update

It has only been a few weeks and Apple has already released an updated firmwave for the iPhone. Could this mean Apple isn't going to sit on bugfixes, are more updates going to be released in the same short time span. A couple of weeks is really short, however a couple of months to improve some iPhone features, fix bugs or release new functionality is something that should be embraced.

Updating a windows driver can cause Vista to de-activate

The full article ventures into the troublesome problem that will leave you with a de-activated Vista, and the only way to get back to normal would be a call to Microsoft and a new Activation Code. Wasn't Vista going to allow 3 hardware swaps, and then you would be required to re-activate your copy of Vista?

Creators Of Mobile Chat For the iPhone Twenty08 Hires AplloIM Developer

If you bought the iPhone when it first came out, you had two choices for Instant Messaging. Twenty08's MobileChat and Alex Schaefer's ApolloIM. Twenty08 has now hired Alex Schaefer to work exclusively on MobileChat
twenty08 would like to formally welcome aboard…Alex Schaefer. Many of you may know him as the founder of the world’s first Native iPhone IM Application, ApolloIM. ApolloIM was an amazing application and during it’s run, MobileChat and Apollo stood head to head and constantly battled to create the better app. (Friendly war of course!) The best part about it was that no one won! Only our respective users benefited from the friendly competition, and you can’t ask for anything better than that as far as I’m concerned. Now with Alex working on our side, we believe that MobileChat will be able to rise up and regain its glory as the number one iPhone application that we all know it can be. He is a very talented developer (plus a great guy) who has already brought some great ideas to the table and we’re all very excited to see our new-found relationship grow.
Read the full article on Twenty08's site. MobileChat's website

Bug Clean up for QuickPwn

Not too long after releasing and updated PwnageTool and Quickpwn, the team has released an update to QuickPwn.
We’ve had some issues with iPod touch devices and the latest version of PwnageTool for the Mac, in certain conditions incorrect permissions will be used and the keychain doesn’t save passwords. So hold on and wait for the next release, we’ll push out the updated version via Sparkle as soon as it is tested (it is being tested right now).

24-hour Test Drive of PC-BSD

My original colocation machine was FreeBSD 4.2 and it was fun to play with. The package system was great, you could either compile or install pre-compiled versions. However, when you upgrade and leave compiled/pre-compiled packages dormant. They can come back to bit you in the ass with dependency issues and the package database breaking. I'm glad someone is making an effort to make it more user friendly, although I don't run BSD I love a lot of its features. 24-hour Test Drive of PC-BSD - An anonymous reader writes "Ars Technica has a concise introduction to PC-BSD, a FreeBSD derivative that emphasizes ease of use and aims to convert Windows users. The review describes the installation process, articulates the advantages of PC-BSD,and reveal some of the challenges that the reviewer faced along the way. From the article: 'In the end, I would suggest this distribution to new users provided they had someone to call in case of a driver malfunction during installation. I would also recommend PC-BSD to seasoned Unix users that have never tried using FreeBSD before and would prefer a shallower learning curve before getting down to business.'"

Read more of this story at Slashdot.