@@ -6,16 +6,15 @@ Prerequisites
6
6
To build Connector/C++, the following tools and libraries are required:
7
7
8
8
- A C++ compiler that supports C++11. In case of gcc it must be at least
9
- version 4.8. These compilers have been tested: gcc 4.8.4, clang 7.3 .0,
10
- MS Visual Studio 2015.
9
+ version 4.8. These compilers have been tested: gcc 4.8.4, 4.8.5, 4.9.2, 5.4 .0,
10
+ 6.3.0, 6.3.1, 7.1.1, 7.2.0, 7.2.1, clang 9.0.0, MS Visual Studio 2015.
11
11
12
- - CMake 2.8.11 or later.
12
+ - CMake 2.8.12 or later.
13
13
14
14
- OpenSSL version 1.0.x if connector is built with OpenSSL.
15
15
16
16
@note: On some platforms Boost libraries are needed to build the connector.
17
- Boost version 1.55 or higher is required (for MS Visual Studio
18
- version 1.59 or higher).
17
+ Boost version 1.59.
19
18
20
19
Build configuration
21
20
-------------------
@@ -44,6 +43,27 @@ By default a shared library is built. To build a static library, use the option:
44
43
45
44
- `-DBUILD_STATIC=yes`
46
45
46
+ Building of the legacy C++ JDBC4 library
47
+ ----------------------------------------
48
+ Connector/C++ supports the legacy C++ JDBC4 API, which is placed inside a
49
+ separate library `libmysqlcppconn` or `mysqlcppconn` depending on the Operating
50
+ System.
51
+
52
+ In order to enable building of the legacy C++ JDBC4 library the Connector/C++
53
+ needs to be built with the following options:
54
+
55
+ - `WITH_JDBC` to enable the legacy C++ JDBC4 API. Usage of this option in cmake
56
+ command looks like this: `-DWITH_JDBC=yes`. By default this option is not
57
+ enabled and the legacty C++ JDBC4 functionality is not built.
58
+
59
+ - `MYSQL_DIR` to allow using server libraries such as libmysqlclient if it is
60
+ not installed at the default location.
61
+ The command line should look like: `-DMYSQL_DIR=<path_to_mysql_server_dir>`
62
+
63
+ - `WITH_BOOST` to point to boost location if it is different from the default.
64
+ The command line should look like: `-DMYSQL_DIR=<path_to_mysql_server_dir>`
65
+
66
+
47
67
Configuring SSL libraries
48
68
-------------------------
49
69
Connector/C++ can be built with different SSL libraries.
@@ -84,10 +104,18 @@ It is also possible to omit the `--config CCC` option in which case the default
84
104
After a successful build, the build location should contain
85
105
the Connector/C++ shared library:
86
106
87
- - `libmysqlcppconn8.so.1.0 ` on Unix
88
- - `libmysqlcppconn8.1.0. dylib` on OS X
107
+ - `libmysqlcppconn8.so.1` on Unix
108
+ - `libmysqlcppconn8.1.dylib` on OS X
89
109
- `CCC/mysqlcppconn8-vsXX.dll` on Windows, where `-vs12` or `-vs14` prefix
90
110
depends on the MSVC version used to build the connector
111
+
112
+ If Connector/C++ is built to support the legacy C++ JDBC4 API (WITH_JDBC option
113
+ enabled) the build library directory will have another shared library:
114
+
115
+ - `libmysqlcppconn.so.7` on Unix
116
+ - `libmysqlcppconn.7.dylib` on OS X
117
+ - `CCC/mysqlcppconn-7-vsXX.dll` on Windows, where `-vs12` or `-vs14` prefix
118
+ depends on the MSVC version used to build the connector
91
119
92
120
On Unix and OS X also appropriate symbolic links are created. On Windows the
93
121
import library for the DLL is created at `CCC/mysqlcppconn8.lib` (the `CCC/`
@@ -96,8 +124,15 @@ subdirectory is named the same as the build configuration used).
96
124
In the case of a static library build, the output library names are:
97
125
98
126
- `libmysqlcppconn8-static.a` on Unix and OS X
99
- - `CCC/mysqlcppconn8-static.lib` on Windows
127
+ - `CCC/mysqlcppconn8-static.lib` and `CCC/mysqlcppconn8-static-mt.lib`
128
+ on Windows
129
+
130
+ If Connector/C++ is built to support the legacy C++ JDBC4 API (WITH_JDBC option
131
+ enabled) the build library directory will have another static library:
100
132
133
+ - `libmysqlcppconn-static.a` on Unix and OS X
134
+ - `CCC/mysqlcppconn-static.lib` and `CCC/mysqlcppconn-static-mt.lib`
135
+ on Windows
101
136
102
137
### Testing
103
138
@@ -130,8 +165,8 @@ $ cmake -DWITH_CONCPP=<Connector/C++ install location> <source location>/testapp
130
165
$ cmake --build . --config CCC
131
166
~~~~~~~
132
167
133
- This should create the `devapi_test` and `xapi_test` executables in the `run/`
134
- subdirectory of the build location.
168
+ This should create the `devapi_test`, `xapi_test` and `jdbc_test` executables
169
+ in the `run/` subdirectory of the build location.
135
170
136
171
@note
137
172
On Windows, if the connector was built with the static runtime by specifying
@@ -142,6 +177,9 @@ subdirectory of the build location.
142
177
The 32/64-bit Windows `cmake` generator (`"Visual Studio 14 2015 Win64"` vs
143
178
`"Visual Studio 14 2015"`) used to build test applications must match
144
179
the one used to build the connector.
180
+
181
+ @note in order to build `jdbc_test` the Connector/C++ has to be built
182
+ with WITH_JDBC, MYSQL_DIR and WITH_BOOST options.
145
183
146
184
Before running test programs, ensure that a MySQL Server instance is running
147
185
with X Plugin loaded into it. The easiest way of arranging this is to use
@@ -167,24 +205,17 @@ the standard 33060 one.
167
205
Now one can start one of the test programs and see the output similar to the
168
206
one presented below. The `devapi_test` program accepts port number as the first
169
207
argument, with the default value 33060. Thus, if the server was started
170
- as described above, run the test program as follows :
208
+ as described above, run the test program with the following URL as a parameter :
171
209
172
210
~~~~~~~
173
- $ run/devapi_test 13009
211
+ $ run/devapi_test
mysqlx://[email protected] : 13009
174
212
~~~~~~~
175
213
176
214
The program uses the `root` user account without any password and assumes
177
215
that there is a `test` schema in the server (these assumptions hold for
178
216
a server started using `mysql-test-run.pl`). Different user credentials can
179
217
be passed as the second and the third argument of `devapi_test` invocation.
180
218
181
- For the `xapi_test` program, connection details can be given in form of an URL,
182
- as shown below:
183
-
184
- ~~~~~~~
185
- $ run/xapi_test mysqlx://
[email protected] :13009
186
- ~~~~~~~
187
-
188
219
If everything goes well, `devapi_test` should produce output similar to this:
189
220
190
221
~~~~~~~
@@ -222,6 +253,20 @@ doc#1: {"_id": "A0ABC08DAABAD1110C120800273BD115", "age": 2, "name": "bar", "toy
222
253
Done!
223
254
~~~~~~~
224
255
256
+ For the `xapi_test` program, connection details can be given in form of an URL,
257
+ as shown below:
258
+
259
+ ~~~~~~~
260
+ $ run/xapi_test mysqlx://
[email protected] :13009
261
+ ~~~~~~~
262
+
263
+ For the `jdbc_test` program the command line would look as this:
264
+
265
+ ~~~~~~~
266
+ $ run/jdbc_test tcp://127.0.0.1:13009 root
267
+ ~~~~~~~
268
+
269
+
225
270
Windows Notes
226
271
-------------
227
272
Connector/C++ uses C++11 language and for that reason it is not possible
@@ -256,7 +301,7 @@ the compiler and the linker invocations. Another option is to set the required
256
301
deployment target and then the compiler defaults are changed accordingly.
257
302
To define the deployment target, set the environment variable
258
303
`MACOSX_DEPLOYMENT_TARGET` to the requested OS X version. Binary distributions
259
- of Connector/C++ are built with `MACOSX_DEPLOYMENT_TARGET` set to `10.9 `.
304
+ of Connector/C++ are built with `MACOSX_DEPLOYMENT_TARGET` set to `10.12 `.
260
305
261
306
Building Connector/C++ with `gcc` or its `libstdc++` runtime has not been
262
307
tested and there is no support in the build system for using an alternative
0 commit comments