MySQL Ubuntu OpenSSL Support

21 Oct 2009

Ubuntu packages MySQL with yassl support instead of OpenSSL. These two implementations are incompatible. Recently we found this out at work as Red Hat and OpenSUSE both bundle MySQL with OpenSSL. One of our MySQL servers is running on Red Hat and we were unable to connect using the Ubuntu binary MySQL client. This of course also breaks things like the php-mysql, python-mysql and ruby-mysql libraries as they are compiled against the MySQL client on the distribution.

Here are the steps on how to compile the MySQL client with OpenSSL support.

Install needed utilities

apt-get install build-essential openssl openssl-dev libncurses5 libncurses5-dev

build-essential gives you gcc and all the stuff needed to compile and make and such

openssl, openssl-dev gives you the openssl libraries to compile against

libncurses5, libncurses5-dev were recommended by one of the sites I used to compile the client

Download Source

You will need to download the MySQL source code from

You can download the zip or tarball, doesn’t matter which. I recommend using wget to download the file


Unpack the file using unzip or tar xzvf. Unzip is not installed by default on Ubuntu so you may need to install it.

apt-get install unzip

Enter the directory


Configure, make, make install

This was the single most important mistake that I made. From the instructions at

you can see the –disable-shared flag they use. I’m not entirely certain, but I believe this does not create dynamic libraries so

other things cannot compile against the shared libraries which you need if you are intending on also compiling things like mysql for php, python, ruby, etc.

./configure –prefix=/usr/local/mysql










Now compile and push the files where they need to go

make; make install;

Link the executables and libraries to the appropriate place

ln -s /usr/local/mysql/bin/* /usr/bin/

ln -s /usr/local/mysql/lib/mysql/*.so* /usr/lib/

MySQL Module for Python

Now that you have the MySQL client libraries compiled with SSL you can install other modules. Since the object for me was to get MySQLdb installed with OpenSSL in Ubuntu I’m attaching the instructions for that as well

Download the .egg

Python 2.6

Python 2.5

Install Python utilities

apt-get install python-dev python-setuptools

Install Module



«« Previous Post Next Post »»