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
You will need to download the MySQL source code from http://dev.mysql.com/downloads/mysql/5.1.html#downloads
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 http://ubuntuforums.org/showthread.php?t=708145
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.
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
Install Python utilities
apt-get install python-dev python-setuptools