Fetching contributors…
Cannot retrieve contributors at this time
319 lines (277 sloc) 15.8 KB
These are extra instructions for ocelotgui for Windows.
The Windows ocelotgui program has the same functionality
as the Linux ocelotgui program, but is newer and has only
been tested with basic Windows 10 64-bit machinery.
We believe that on some Windows platforms it won't start.
Treat it as "alpha".
Connection should work to any modern MySQL or MariaDB server.
How to get it:
* Download the file from github.
to see where the latest release is. For example it might be
* Unzip. It was zipped with 7-zip from,
but other utilities should work. For example, on Windows command prompt,
if you have the PowerShell utility on your path:
PowerShell Expand-Archive c:\ocelotgui
* Read the COPYING and LICENSE arrangements.
On Windows ocelotgui is statically linked to Qt and MariaDB libraries,
so the copyright and licensing is not the same as for Linux.
* The unzipped package includes a file named ocelotgui.exe.
This is the file that you need for day-to-day ocelotgui use.
There is no installation file.
There is no need to download a MySQL/MariaDB client library.
There is no need to download a Qt library.
Since ocelotgui.exe may read other files on the same directory,
it is best to leave it in the directory that you unzipped to.
How to test it:
Start up a MySQL or MariaDB server that is easily accessible
(ocelotgui can use SSL etc. but for an initial test make it easy).
Let's assume the download directory is c:\ocelotgui.
Let's assume the host is, the user name is 'root',
the password is 'root', the port is 3306. Say:
c:\ocelotgui.exe --port=3306 --host= --port=3306 --user=root --password=root --protocol=tcp
Full instructions are in the main documentation.
The following notes are specifically for ocelotgui for Windows.
* When connecting, use protocol=tcp.
* this is a 32-bit .exe file
* these DLLs are used ... (they're all supplied with Windows 10)
ntdll.dll, wow64.dll, wow64win.dll, wow64cpu.dll
-- should be in system32 for 32-bit process running on a 64-bit computer
* this DLL might be used: libeay.dll.
It only matters if there is a .mylogin.cnf file, which is rare.
If libeay.dll is not found on the system, .mylogin.cnf is ignored.
* notice that the licence is slightly different from the Linux distribution,
because the MariaDB client library and the Qt library are statically linked
(in the Linux distribution they are dynamically linked and supplied separately).
* the program does not always take over the screen at start time.
You have to look for an icon on the bottom and click it,
or check the task manager.
* initial application load is very slow, although after that there are no known performance problems.
The rest of this document is for advanced users only.
Building ocelotgui.exe from source
Although building ocelotgui from source on Windows should rarely be necessary,
here are instructions for doing so. You will need:
Windows 10,
the source code of ocelotgui (which we always supply with the package),
an unzipper such as 7-zip,
the source code of Qt,
the MinGW 32-bit compiler version 5.30 (it comes with Qt),
the source code of MariaDB.
Building takes 6 to 60 hours depending on hardware, and at least 40GB
disk space. We used a 64GB USB stick.
We happened to have Microsoft's Windows SDK available when we built;
it didn't hurt, but we do not believe it was necessary.
We assume that %path% includes c:\windows\system32 and all other Windows
system directories that are normally in the default Windows 10 path.
In what follows, we assume the available space is on drive D:.
In what follows, comment lines begin with colons.
: If you are using a laptop, turn off power-saving features until this job is done.
: (Getting an unzipper)
: Install 32-bit 7-zip from
: In what follows, we assume the 7-zip program is on C:\Program Files (x86).
: But we believe any unzipper will do.
: (Downloading Qt libraries)
: We assume that you have downloaded Qt, other than the source.
: When accessing Qt downloads, you should choose version 5.9.1
: (other versions might work but 5.9.1 is the version we used).
: You must choose "open source". It will affect directory names.
: Go to
: Get qt-unified-windows-x86-3.0.1-online.exe, put it on drive C.
: cd c:\
: qt-unified-windows-x86-3.0.1-online.exe
: If the MinGW compiler is not already there, run Qt's maintenance tool.
: (Unzipping Qt source)
: Download
: to C:\Qt\Static\src.
: First produce a .tar from the .tar.xz file.
"C:\Program Files (x86)\7-Zip\7z" x qt-everywhere-opensource-src-5.9.1.tar
: Now you have to be in administrator mode to avoid ""ERROR: Can not create symbolic link" errors during unzip:
: Right-click Windows icon on bottom left of screen.
: Click Command Prompt(Admin)
: Click yes -- notice you get to C:\Windows\system32 instead of \Users\your-name.
cd c:\Qt\Static\Src
"C:\Program Files (x86)\7-Zip\7z" x qt-everywhere-opensource-src-5.9.1.tar
It went into c:\Qt\static\src\qt-everywhere-opensource-src-5.9.1
: This is the point when we realized drive C: would not be large enough,
: so we inserted the USB stick for drive D: and copied all Qt files from
: C:\Qt to D:\Qt, using xcopy.
: (Specifying qmake.conf flags)
: In d:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtbase\mkspecs\win32-g++\qmake.conf
: add these lines after QMAKE_NM:
: QMAKE_LFLAGS += -static -static-libgcc
: QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
: (Building Qt static libraries)
: Almost certainly this is not the most efficient way to configure.
: We could say "skip" for many more subdirectories just below the main one.
: We are saying "opengl desktop" because it happened to work, but Qt seems
: to recommend "opengl dynamic" nowadays.
: The "-opensource" is necessary because ocelotgui is open source.
: The prefix directory d:\Qt\Qt5.9.1Static is an arbitrary name, you can
: use a different one provided that you use the same name throughout.
: The "-release" option is chosen because the alternative "debug"
: is reportedly extremely large.
: Although -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-harfbuzz refer
: to third-party components, ocelotgui does not explicitly link to them,
: we intend to remove mention of them the next time we build Qt from source.
: D:\Qt\Static\src\qt-everywhere-opensource-5.9.1 is the top level
: directory and must be the default directory -- do not shadow build.
: Pause after configure to read any error or warning messages.
cd d:\
rd /s /q D:\Qt\Qt5.9.1Static
SET PATH=d:\Qt\Tools\mingw530_32\bin;d:\Qt\Tools\mingw530_32\opt\bin;%path%
set LANG="en"
set QT_INSTALL_PREFIX=d:\Qt\Qt5.9.1Static
cd d:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1
del /s *.o
del /s moc_*
configure -opensource -confirm-license -release -platform win32-g++ -static -opengl desktop -make libs -nomake examples -nomake tests -nomake tools -prefix d:\Qt\Qt5.9.1Static -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns
: pause
mingw32-make install
: (Building the MariaDB library)
: You have to build MariaDB Connector C yourself so there will be a .a
: file not a .lib file. We used the source of version 2.2.3 Stable.
: Probably 2.1 or 2.3 would work too, feel free to try other versions
: listed on the MariaDB Connector C download page
: but do not try MariaDB Connector C 3.0.2 because it uses InitOnceExecuteOnce(),
: a kernel32 function which isn't present before Windows Vista,
: and which our version of MinGW doesn't expect.
: Make a directory d:\mariadb.
cd \
rd /s /q mariadb
mkdir mariadb
cd mariadb
: Download from
: to d:\mariadb -- if it does not go there directly, copy it to there.
: Unzip.
"C:\Program Files (x86)\7-Zip\7z" x mariadb-connector-c-2.2.3-src.tar.gz
"C:\Program Files (x86)\7-Zip\7z" x mariadb-connector-c-2.2.3-src.tar
: Now you must edit one file.
: d:\mariadb\mariadb-connector-c-2.2.3-src\libmariadb\my_pthread.c
: Change
: #ifdef _WIN32
: to
: #if defined(_WIN32_IMPOSSIBLE) && !defined(__MINGW__)
: Thus you eliminate pthread_cond_init() + pthread_cond_timedwait()
: + pthread_cond_wait() + pthread_cond_destroy()
: because MinGW already has them.
cd mariadb-connector-c-2.2.3-src
mingw32-make clean
cmake -G "MinGW Makefiles"
: Now you should have a file named
: mariadb\mariadb-connector-c-2.2.3-src\libmariadb\libmariadbclient.a
: This is the file that we used for static linking.
: We did not try to do anything with the other .a file, liblibmariadb.dll.a,
: but perhaps we should have.
: (making ocelotgui.exe)
: We have built Qt as "release", but we do not want to use the
: compiler flags that come with "release" because we need guard
: bytes when we call MariaDB's mysql_init() function. Possibly
: we only need to turn the flags off with #pragma when we're calling
: certain MariaDB functions; possibly we'll try that someday.
: We will not use the CMakeLists.txt file in the ocelotgui package,
: that is for use with Linux. We will start with a modified
: We will still need the MinGW bin and lib directories.
: Earlier we said prefix is D:\Qt\Qt5.9.1static, that is the Qt directory we need.
: There will be an error message when you say mingw32-make the first time; we ignore it.
: There will be warnings during compile; we ignore them.
: Change so that after the Copyright + License notice it looks like this.
: When we built we forgot to say DEFINES += STATIC, but for us it works anyway.
QT += core gui widgets
TARGET = ocelotgui
CONFIG += warn_on
CONFIG += static
CONFIG += console
QMAKE_CXXFLAGS = -fpermissive
SOURCES += ocelotgui.cpp
HEADERS += ocelotgui.h
HEADERS += codeeditor.h
HEADERS += install_sql.cpp
HEADERS += hparse.h
HEADERS += ostrings.h
HEADERS += third_party.h
FORMS += ocelotgui.ui
INCLUDEPATH += "d:\mariadb\mariadb-connector-c-2.2.3-src\include"
LIBS += -Ld:\mariadb\mariadb-connector-c-2.2.3-src\libmariadb -lmariadbclient
cd d:\ocelotgui
SET PATH=D:\Qt\Qt5.9.1Static\bin;D:\Qt\Qt5.9.1Static\lib;d:\Qt\Tools\mingw530_32\bin;d:\Qt\Tools\mingw530_32\lib;%path%
mingw32-make clean
: (Test)
release\ocelotgui.exe --ocelot_dbms=tarantool
: (Making the .zip file)
: The package should be the same as what we distribute in the Windows release.
: It includes several files which are used for Linux; this is harmless.
: The file names are approximately the same as the ones on,
: in fact this list is merely the result of concatenating "ocelotgui.exe" with an ocelotgui direcory listing.
: Make sure you can unzip with both 7-zip and winzip.
"C:\Program Files (x86)\7-Zip\7z" a -tzip ocelotgui.exe changelog manual.htm ocelotgui_logo.png shot8.jpg CMakeLists.txt menu-debug.png shot9.jpg codeeditor.h menu-edit.png ocelotgui.ui special-detach.png COPYING menu-file.png options.txt shot10.jpg special-images.png COPYING.thirdparty menu-help.png ostrings.h shot11.png special-settings.png copyright menu-options.png README.htm shot1.jpg special-vertical.png debugger.png menu-run.png shot2.jpg starting-dialog.png debugger_reference.txt menu-settings.png README.txt shot3.png starting.png example.cnf ocelotgui.1 readmylogin.c shot4.jpg statement-widget-example.png hparse.h ocelotgui.cpp result-widget-example.png shot5.jpg third_party.h install_sql.cpp ocelotgui.desktop rpmchangelog shot6.jpg windows.txt LICENSE.GPL ocelotgui.h shot7.jpg tarantool.txt ocelotgui.spec
: (Dynamic linking)
: We have shown the instructions for static build because that is what
: we ship. That does not mean that ocelotgui cannot be done with dynamic
: build. Currently we are not officially supporting it, but it has been done,
: with Qt 5.6.
: You will need Qt, CMake, MySQL, and ocelotgui source.
: For Qt: Go to
: Avoid/skip any suggestion to login -- there can be no special license
: After installation is complete, you should have Qt in
: something like C:\Qt\Qt5.6.1 and MinGW compiler gcc.exe in
: c:\Qt\Qt5.6.1\Tools\mingw492_32\bin\gcc.
: For MySQL: it's simplest to install the whole package,
: although the only things necessary here are the
: client shared library and the usual include files.
: After installation is complete, you should have mysql.h in
: C:\Program Files\MySQL\MySQL Server 5.7\include\mysql.h
: For CMake: go to
: When asked whether to add Cmake to the system path, say yes.
: For ocelotgui: go to
: An easy choice is git clone (to install git, see
: git clone c:\ocelotgui
: change ocelotgui.h so that OCELOT_STATIC_LIBRARY is 0,
: or pass a OCELOT_STATIC_LIBRARY as a variable with value = 0.
: cd c:\ocelotgui
: SET PATH=C:\Qt\qt5.6.1\Tools\mingw492_32\bin;C:\Qt\qt5.6.1\Tools\mingw492_32\lib;C:\Qt\qt5.6.1\5.6\mingw49_32\bin;%path%
: cmake . -G "MinGW Makefiles" -DMYSQL_INCLUDE_DIR="C:/Program Files/MySQL/MySQL Server 5.7/include"
: mingw32-make
: And now there should be a file named c:\ocelotgui\ocelotgui.exe.
: (The GPLv2 "Offer")
: Due to GLPv2 requirements we must ensure that all recipients of ocelotgui
: can have all the source code used to build the executable ocelotgui.exe.
: You already have all ocelotgui's source code -- it is in the package --
: but we do not supply in the package the source code of Qt or MariaDB,
: whose libraries are statically linked. Of course, their source code is
: easily available from the Internet, as we have described above.
: But there is a minuscule chance that they will go out of business.
: If that happens or if for some reason you sincerely need to
: get their source code from Ocelot rather than downloading it, Ocelot
: will mail it on a USB stick for a reasonable fee -- send us a request.
: This offer is valid for three years from the date of the ocelotgui release.