Table of Contents
Normally, you will want to install the MySQL GUI tools from binaries. We put a lot of effort into making sure that our binaries are built with the best possible options. If, for whatever reason, you wish to compile the tools yourself, follow these instructions.
The source code for the MySQL GUI tools is available from our public Subversion trees at http://dev.mysql.com/tech-resources/sources.html.
You will need the mysql-gui-common
tree
regardless of which GUI tools you intend to build. The
mysql-gui-common
tree contains source and
graphics files used for all MySQL GUI tools.
To be able to access these trees, you must have Subversion installed. Subversion is freely available from http://subversion.tigris.org/.
Installing from source under Windows requires multiple commercial compilers and because of this it is preferable to install from binaries. If you meet the prerequisites needed you can build the MySQL GUI tools from source under Windows.
To compile the MySQL GUI tools from source under Windows, you
need Borland Delphi 7, Microsoft Visual Studio.NET 2003, and
some libraries which are available on the internet as open
source software. Make sure the programs
DCC32.exe
and DEVENV.exe
/?
can be launched from the command line.
You will need the following libraries to build from source:
glib-2.0
libxml-2
mysql client libraries (4.0 or newer, 5.0 prefered)
pcre-1.4
MS Visual C runtime libraries 7.1
Java include files 1.4.2_04
Lua 5.0.2
Make sure you have cloned the
mysql-administrator
,
mysql-gui-common
, and
mysql-query-browser
trees, and that their
local directories are located in the same directory, for example
in Personal Files\MySQLGUI\
.
The source files and libraries should be placed into the following tree structure:
Working Directory | |- mysql-administrator |- mysql-gui-common |- mysql-query-browser |- mysql-gui-win-res | |-include | | | |-glib-2.0 | |-java | | | | | |-win32 | | | |-libxml | |-lua | |-mysql | |-pcre | |-windows | |-lib | |-glib-2.0 |-java |-libxml |-lua |-mysql |-pcre |-windows
To build from the command line open a windows command line
prompt and change into the main repository of the tool (i.e.
for MySQL Administrator this is
work\mysql-administrator
). There are three
batch-files to start the build:
build_debug.cmd
build_release.cmd
build_commercial.cmd
Execute one of those to generate a runtime image of the
application. It will be generated in a
bin\windows
directory.
Another method is to doubleclick on one of the
build_
files, where buildtype
.cmdbuildtype
is one of
debug
, release
, and
commercial
. The
commercial
build script is for users with
commercial licenses, and makes use of the commercial version
of the MySQL client library.
Before you can open any projects, you have to install these components. Otherwise some of the forms will not open and you will receive error messages.
To install the components, goto the
mysql-gui-common\source\windows\
directory.
Copy the following directories to your Delphi source directory
(C:\Program Files\Borland\Delphi7\Source\
).
png
SynEdit
TNT
UniCodeEditor
VirtualTreeview
Then doubleclick each *.dpk
file outlined
below. It will open Delphi. Press compile and install to
install the components. Repeat this for each
*.dpk
file.
SynEdit\Packages\SynEdit_D7.dpk
TNT\Packages\TntUnicodeVcl_D70.dpk
VirtualTreeview\Packages\VirtualTreesD7D.dpk
UniCodeEditor\Packages\UniCodeEditorD7.dpk
These components have to be installed via the
option of the menu. Click on the button and select the files below. Press after each file.png\PNGImage.pas
After installing the components you can open the projects as outlined below.
To build the application from the Delphi 7 IDE simply
doubleclick the
edit_
.
This will launch Delphi 7 and open the file. To generate the
complete runtime image select option from the
menu.
xxxx
.cmd
Like for building from command line there are three different files.
edit_debug.cmd
edit_release.cmd
edit_commercial.cmd
The runtime image will be generated in a
bin\windows
directory.
Opening the Delphi project not using the
edit_*.cmd
script will lead to incorrect
project settings and problems while building the
projects.
The easiest way to install required packages is by using an
automatic dependency resolving package manager, such as
apt-get
or yum
. You can
install these dependencies by hand, but it will be a very
tedious process since some of them require other packages that
require other packages and so on.
Common requirements are listed below. For some distributions the package name is also mentioned.
Table B.1. Required Components
Software | Version | Ubuntu 6 | SuSE 10.x |
---|---|---|---|
gcc/g++ | 4 | g++ | gcc-c++ |
autoconf, automake libtool | |||
x11-libs | libx11-dev | xorg-x11-devel | |
glibc | libc6-dev | xorg-xll-devel | |
libstdc++ | libstdc++6-4.0-dev | libstdc++devel | |
glib | 2.6+ | libglib2.0-dev | glib2-devel |
gtk+ | 2.6+ | libgtk2.0-dev | gtk2-devel |
libglade2 | 2.5+ | libglade2-dev | libglade2-devel |
libsigc++ | 2.0.x | libsigc++-2.0-dev | libsigc++2-devel |
glibmm-2.4 | 2.4 | libglibmm-2.4-dev | glibmm24-devel |
gtkmm-2.4 | 2.4 | libgtkmm-2.4-dev | gtkmm24-devel |
pcre | 4.x or newer | libpcre3-dev | pcre-devel |
pkgconfig | 0.15+ | pkg-config | pkgconfig |
libxml2 | 2.6.x | libxml2-dev | libxml2-devel |
MySQL 5.0 or 5.1 client libs and headers | libmysqlclient15-dev |
Additional requirements for building MySQL Query Browser are:
To build any of the tools, you need to have the source tree for
mysql-gui-common
and the tree for the desired
app (i.e.: mysql-administrator
,
mysql-query-browser
) in the same top-level
directory.
First build mysql-gui-common
:
cd mysql-gui-common
sh ./autogen.sh
./configure
--prefix=/opt/mysql-administrator
make
make install
The --prefix
option can have whatever value you
want, normally one would specify /usr/local
(the default) or /usr
, but for making
precompiled binaries, something in /opt
might
be more appropriate.
After you have successfully built
mysql-gui-common
, you can build the individual
tools (in this example we will build mysql-administrator):
cd mysql-administrator
sh ./autogen.sh
./configure
--prefix=/opt/mysql-administrator
make
make install
If everything went well, things should be properly built and installed.
Building static binaries is non-trivial under Linux, due to the enormous number of library dependencies that come from GNOME and associated libraries. Additionally:
Many libraries do not come with their static (lib*.a) versions shipped, so we need to build them ourselves.
Some libraries can't be linked statically, such as glibc, because of libnss*.so.
Some libraries depend on data files and modules from the original package, esp. in case of gtk/gnome. Problems don't only appear when the user is missing these data files; things may not work because different distributions put files in different paths.
The current solution is to build a partially static binary, with
the most common libraries left dynamically linked
(glibc
and gtk
).
gtkmm
, gtksourceview
,
gtkhtml
and dependencies (like gnome) are
linked statically. The ideal solution would be to build custom
binaries for each major/chosen distribution, but we don't have
time/resources for that at the moment.
To build these binaries:
Look at the source/linux/static_make
script for all the files that should be removed/moved out of
/usr/lib
.
Run the script.
That's needed to force the linker to look for the static version of each library and also to explicitly list the dependency libs that were otherwise linked to the dynamic libs.
For building RPMs, a spec file is already supplied and will be
made automatically after ./configure
is ran.
The spec file expects a source tarball with the following
structure:
mysql-administrator/ mysql-administrator/mysql-gui-common/* » mysql-administrator/mysql-administrator/*
The contents of each subdirectory is the entire source tree for each
tool (Windows specific files and source metadata are optional, of
course). You must make a tar.gz
file and put
it in /usr/src/redhat/SOURCES
(or whatever is
your rpm SOURCES directory).
Then, execute: rpmbuild -ba
mysql-administrator.spec
That should build the srpm and rpm files for the tool.