forked from mysql/mysql-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
119 lines (87 loc) · 3.13 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Build Instructions for MySQL Shell
Dependencies
============
Mandatory
- cmake 3.5.1 (note: if you're using a very recent version of cmake and it
doesn't work, try downgrading)
- gcc 5/VisualStudio 2015/clang 8
- MySQL client libraries built from sources
(libmysqlclient, libmysqlxclient)
- zip (gnuwin32 in windows)
- python 3.8+
- libssh 0.9.2
Optional
- gtest and gmock 1.8 (can be automatically downloaded)
- v8 10.9.194.10
Building From Source
====================
The following instructions build MySQL Shell with a minimal set of features,
additional features can be included by properly configuring the related
dependencies.
Preparation
-----------
MySQL
.....
The MySQL server sources are required to compile with the X protocol client library.
1) Download and unpack MySQL (8.0.11 or newer) source code
2) Configure MySQL server:
mkdir mysql-server/bld
cd mysql-server/bld
cmake .. -DWITH_BOOST=<path to boost> -DWITH_SSL=system
If boost is not available use the next options to let cmake download the
required version:
-DDOWNLOAD_BOOST=1 -DENABLE_DOWNLOADS=1
3) Compile the client libraries:
cmake --build . --target mysqlclient
cmake --build . --target mysqlxclient
Alternatively you can build the entire server:
make
Building the Shell
------------------
1) Download and unpack MySQL Shell source code
2) Configure and Build
Linux/OSX
mkdir mysql-shell/bld
cd mysql-shell/bld
cmake .. \
-DMYSQL_SOURCE_DIR=../../mysql-server\
-DMYSQL_BUILD_DIR=../../mysql-server/bld\
-DHAVE_PYTHON=1\
<other options>
make -j4
Windows
mkdir bld
cd bld
cmake .. -G "Visual Studio 16" \
-DMYSQL_SOURCE_DIR=../../mysql-server\
-DMYSQL_BUILD_DIR=../../mysql-server/bld\
-DWITH_STATIC_LINKING=1 \
-DHAVE_PYTHON=1\
-DPYTHON_LIBRARY=<path_to_python_library> \
-DPYTHON_INCLUDE_DIR=<python_src>\include;<python_src>\PC
Open the generated solution mysh.sln and build it using Visual Studio.
* Note that in Windows, all dependencies must be built with compatible build
settings, specially regarding Release vs Debug and /MD vs /MT.
Enabling JavaScript Support
---------------------------
JavaScript is enabled by satisfying the dependency with V8.
To build V8 follow the build V8 standard build instructions.
To support JavaScript on the MySQL Shell add the next flags to the CMake call:
-DHAVE_V8=1
-DV8_INCLUDE_DIR=<path_to_v8>/include
-DV8_LIB_DIR=<path_to_folder_containing_the_built_libraries>
Note that version 10.9.194.10 is needed and newer versions may not work.
Enabling Python Support
-----------------------
Python is enabled by satisfying the dependency with Python.
To support Python on the MySQL Shell add the next flags to the CMake call:
-DHAVE_PYTHON=1
Additional for windows only:
-DPYTHON_LIBRARY=<path_to_python_library>
-DPYTHON_INCLUDE_DIR=<python_src>\include;<python_src>\PC
Adding Unit Test Support
------------------------
GTest is required to enable Unit Testing. Make them available by adding the
following parameters to the cmake call.
-DWITH_TESTS=1
-DENABLE_DOWNLOADS=1