Wednesday, October 26, 2011

Building MySQL Workbench from Source for Ubuntu 11.10 Oneiric

If you use MySQL Workbench for web app development as much as I do, you'll be disapointed to learn that it breaks in Ubuntu 11.10 Oneiric. MWB just hung on the splash screen for more than 10 minutes on startup despite several aptitude update/upgrade and reboots. Only way out was pkill mysql-workbench.

According to the folks at MySQL, this is a verified bug for Ubuntu 11.10 and there's a MWB source code patch for the latest version (MySQL Workbench 5.2.35).

Here's the full procedure to download, patch, build, and install a working MWB on the latest Ubuntu.

# MWB version number to build and install

# install the Ubuntu prerequisites (dependencies)
# I'm sure there's a cleaner way, but this is everything:
sudo apt-get install autoconf automake build-essential g++ libboost-dev libctemplate-dev libglade2-dev libglu1-mesa-dev libgnome-keyring-dev libgnome2-dev libgtkmm-2.4-dev liblua5.1-0-dev liblua5.1-dev libmysqlclient15-dev libpcre3-dev libsigc++-2.0-dev libsqlite3-dev libtool libxml2-dev libzip-dev lua5.1 python-dev python-pexpect uuid-dev

# change to whatever directory your do your source builds in
cd ~/src

# get the source code directly from
wget -nd --progress -c -v "${FILENAME}.tar.gz/from/" -O "${FILENAME}.tar.gz"

# extract the downloaded tgz compressed source code package
tar -zxvf "${FILENAME}.tar.gz"

# get into that newly created source directory

# get the patch file to fix the build-time and run-time freezes
wget -O "$PATCHNAME"

# apply the patch
patch --verbose -p0 < "$PATCHNAME"

# automatically build a makefile based on your OS and settings

# you may get a warning like this ...
# aclocal.m4:16: warning: this file was generated for autoconf 2.61.
# You have another version of autoconf. It may work, but is not guaranteed to.
# but it didn't cause me any trouble

# the build will take about an hour on a slow laptop,
# so make sure you're plugged in and have something to read
# -j2 limits the number of separate jobs/tasks spawned to only 2
make -j2

# install it
sudo make install

Don't mistakenly apply this patch to older MWB versions (like 5.1.19). Here's the entire procedure for downloading, patching, building, and installing MySQL Workbench on Ubuntu 11.10.

And if you get tired bug patching src making, and want to escape from it all, we're "declaring victory" on the dream life and selling our boat to return to the real world.

1 comment:

  1. I think Valentina Studio is better free tool for linux, windows and Mac OX S