MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
Building MySQL Workbench from sources on Ubuntu/Debian

To build MySQL Workbench one would need to install dependencies, fetch source code, configure it and actually do a build. Here’s how to do it on a Ubuntu/Debian system

 

1) Get source code

Open the browser and go to http://www.mysql.com/downloads/workbench/

When in that page, select “Source Code” from the select box. Usually the TAR file will do the job, so download the “Generic Linux” option and uncompress it:

$> tar xf mysql-workbench-community-<version>-src.tar.gz

 

2) Install dependencies necessary to build

We’ll need to remove iodbc, if it’s installed

$> sudo apt-get remove iodbc

 

Now, we can install the full set of dependencies needed to build Workbench

$> sudo apt-get install build-essential cmake cmake-data autoconf automake pkg-config libtool libzip-dev libxml2-dev libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libglu1-mesa-dev libgl1-mesa-glx mesa-common-dev libmysqlclient-dev libmysqlcppconn-dev uuid-dev libpixman-1-dev libpcre3-dev libgnome2-dev libgnome-keyring-dev libgtk2.0-dev libpango1.0-dev libcairo2-dev python-dev libboost-dev libctemplate-dev mysql-client python-pysqlite2 libsqlite3-dev libtinyxml-dev swig libvsqlitepp-dev libgdal-dev libproj0

 

3) Prepare to build

Go to the directory where you uncompressed the TAR file

$> cd mysql-workbench-community-<version>-src

Now, create the directory where the build files will reside and go there

$> mkdir wb-build

$> cd wb-build

 

4) Build and install

Build and install Workbench, and optionally set the install prefix (defaults to /usr/local)

$> cmake [-DCMAKE_INSTALL_PREFIX=/usr] ..
$> make
$> sudo make install

If you don’t want to install it on the system directories or don’t have permissions to do so, try to install on the current directory. Be aware that the Workbench launch script must be updated to the proper directories

$> make install DESTDIR=.

 

Notes:

  • You will need swig 1.3 to build WB
  • Antlr 3.4 is needed, but the current release has many bugs. You will need it patched with https://github.com/antlr/antlr3/pull/43 if you don’t want to use the bundled version. Then you’ll need to

          export ANTLR_JAR_PATH=<path_to_antlr_complete_file>

  • Instead of iodbc you can use unixodbc, to do that you need to install unixodbc and add -DUSE_UNIXODBC=True to cmake
  • Ubuntu Packages require unixodbc, so if you’re using it, there won’t be any problem. If you want to use iodbc, you’ll need to build it from source.
  • On a Core2 Quad 2.4 GHz and a 4G of RAM it takes about 30-40 minutes to build Workbench. Also it uses about 5G of hard drive space to build and install.