Building MySQL Workbench from sources on Ubuntu/Debian

October 17, 2011 – 6:30 pm by Maksym Yehorov

To build MySQL Workbench one would need to install dependencies, fetch source code, configure it and actually do a build.

Note: 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 4.2G of hdd space to build.

Here are steps to build Workbench on Ubuntu/Debian:

1) install deps. It is better to use terminal. The command to install deps is below:

sudo apt-get install build-essential autoconf automake libtool libzip-dev libxml2-dev libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libglu1-mesa-dev libmysqlclient15-dev uuid-dev liblua5.1-dev libpcre3-dev g++ libglade2-dev libgnome2-dev python-pexpect libboost-dev libsqlite3-dev python-dev libgnome-keyring-dev libctemplate-dev

2) Get source code from http://www.mysql.com/downloads/workbench/

3) unpack downloaded archive and run autogen.sh from the unpacked directory. The actual invocation may vary, for example:

./autogen.sh –prefix=/usr/local

or

./autogen.sh –prefix=/opt/

–prefix tells configuration utility that install of Workbench should be done using the pivot directory.

Upon successful completion ./autogen.sh should generate Makefiles.

4) Build the tool.

That is simply make. If you have more than one core the you may like to use parallel build. For example, on a 4 cores box it is advised to use make -j5 install, on 2 cores – make -j3 install.

When built and installed, the directory which contains source files can be deleted.

UPD: to apply patch, get in the source directory and do patch -p0 < 5.2.35-ubuntu_11_10_compile_fix.patch

UPD2: libglitz* is no longer needed to compile Workbench.

 

Maksym Yehorov

  1. 20 Responses to “Building MySQL Workbench from sources on Ubuntu/Debian”

  2. Thanks for this!

    When I try running:
    sudo apt-get install build-essential autoconf automake libtool libzip-dev libxml2-dev libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libglu1-mesa-dev libmysqlclient15-dev uuid-dev liblua5.1-dev libglitz-dev libglitz-glx-dev libpcre3-dev g++ libglade2-dev libgnome2-dev python-pexpect libboost-dev libsqlite3-dev python-dev libgnome-keyring-dev libctemplate-dev

    I get the following message:
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting ‘libmysqlclient-dev’ instead of ‘libmysqlclient15-dev’
    Note, selecting ‘liblua5.1-0-dev’ instead of ‘liblua5.1-dev’
    E: Unable to locate package libglitz-dev
    E: Unable to locate package libglitz-glx-dev

    If I then try to run ./autogen.sh –prefix=/usr/local I get:
    **Error**: You must have `autoconf’ installed.
    Download the appropriate package for your distribution,
    or get the source tarball at ftp://ftp.gnu.org/pub/gnu/
    ./autogen.sh: 31: autoheader: not found

    **Error**: You must have `libtool’ installed.
    You can get it from: ftp://ftp.gnu.org/pub/gnu/

    **Error**: You must have `automake’ installed.
    You can get it from: ftp://ftp.gnu.org/pub/gnu/

    Any idea about what I’m doing wrong? Thanks!

    By A.H. on Oct 17, 2011

  3. Works great, thank you.

    For anyone trying this on Ubuntu 11.10, the dependencies are slightly different than what is in the post. Here’s what worked for me:

    sudo apt-get install build-essential autoconf automake libtool libzip-dev libxml2-dev libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libglu1-mesa-dev libmysqlclient-dev uuid-dev liblua5.1-0-dev libpcre3-dev g++ libglade2-dev libgnome2-dev python-pexpect libboost-dev libsqlite3-dev python-dev libgnome-keyring-dev libctemplate-dev

    Other than that, build was done in just over 7 minutes on my AMD hexacore.

    By Richard Ayotte on Oct 17, 2011

  4. Ubuntu Oneric haven’t libglitz-dev, libglitz-glx-dev in repositories!
    However Workbench builds fine.
    Splash screen do not freeze aplication, BUT SQL-editor doesn’t opens!
    ER-Models opens, but don’t display!
    Works only administration.
    Workbench totaly useless in Oneric now

    By Xatory on Oct 18, 2011

  5. Thank you for these instructions, they work perfectly on Ubuntu 11.10 (after applying that patch you provided).

    I (or rather apt-get) couldn’t find libglitz-dev and libglitz-glx-dev, but it worked anyway without these two libs.

    By Andy on Oct 18, 2011

  6. yeaa it’s work! Thanx a lot

    By Ivan on Oct 18, 2011

  7. Where do I get the source for “5.2.35-ubuntu_11_10_compile_fix.patch”?

    By Alex Hilamn on Oct 19, 2011

  8. libglitz-dev libglitz-dev-glx not found in ubuntu 11.10

    By Søren on Oct 19, 2011

  9. Using Ubuntu 11.10, what are the chances this is built for 32 & 64 bit Ubuntu 11.10 with the fix ?

    By Jimbo99 on Oct 19, 2011

  10. When I attempting step 1 (install deps), I get the following error message:

    E: Unable to locate package libglitz-dev
    E: Unable to locate package libglitz-glx-dev

    Where are Ubuntu 11.10 compatible versions of these packages?

    By Dave Power on Oct 19, 2011

  11. libglitz is not needed anymore, you don’t need to install it.

    By akojima on Oct 19, 2011

  12. Links to the patch are on this blog at the bottom:

    http://100days.demonpenguin.co.uk/

    PS-I tried doing this and without a step by step I keep getting messages that block me from doing the whole process of making a deb to install. I’ll wait until it’s really fixed and a version for 11.10 is a real downloadable deb. Wasted enough time on this already.

    By Jimbo99 on Oct 20, 2011

  13. Hi,
    I try to install on Oneiric version of Ubuntu but it failed and finished with :

    In file included from mdc_canvas_view.h:31:0,
    from mdc_area_group.cpp:28:
    /usr/include/glib-2.0/glib/gthread.h:28:2: error: #error “Only can be included directly.”
    make[4]: *** [mdc_area_group.lo] Erreur 1
    make[4]: quittant le répertoire « /opt/mysql-workbench-gpl-5.2.35-src/library/canvas/src »
    make[3]: *** [all-recursive] Erreur 1
    make[3]: quittant le répertoire « /opt/mysql-workbench-gpl-5.2.35-src/library/canvas »
    make[2]: *** [all-recursive] Erreur 1
    make[2]: quittant le répertoire « /opt/mysql-workbench-gpl-5.2.35-src/library »
    make[1]: *** [all-recursive] Erreur 1
    make[1]: quittant le répertoire « /opt/mysql-workbench-gpl-5.2.35-src »
    make: *** [all] Erreur 2

    Could the problem come frome gtk or glib?
    Any ideas?

    By Laurent Hoareau on Oct 24, 2011

  14. Hi, what do you mean by “get in the source directory”… Can u show us more details? like : (Home->Documents->blablabla…)

    thx…
    i appreciate ur answer…

    By wira on Nov 12, 2011

  15. Direct link to the article with the Ubuntu Patch -> http://100days.demonpenguin.co.uk/2011/10/18/day-37/

    By Ling on Dec 7, 2011

  16. I’ve managed to compile a .deb installer for mysql workbench 5.2.37 and documented a fix for the alter table issue:

    http://forums.zpanelcp.com/thread-3331.html

    The above forum page supplies a link to download both the .deb and fix for mysql workbench for debian 6.0.3 stable.

    By Caffeine Addict on Feb 20, 2012

  17. configure: error: Required library libiodbc is missing. Use –with-unixodbc if you want to use unixODBC instead

    what should I do
    (debian 6, gnome desktop)

    By xao on Aug 24, 2012

  18. Hi,

    I have a problem when I try to start mysql-workbench by command line:

    bruno@notebookBruno:~$ mysql-workbench-bin
    Initializing AdvancedSidebar factory method
    Initializing mforms factory
    Crating WBOptions
    Segmentation fault

    What should I do?

    By Bruno Mendonça on Sep 28, 2012

  19. Bruno, Where did you get the binary from?

    By akojima on Nov 6, 2012

  1. 2 Trackback(s)

  2. Oct 18, 2011: Building MySQL Workbench from sources on... | MySQL | Syngu
  3. Oct 18, 2011: 100 Days - Day 37

Post a Comment


+ two = 11