MySQL Router 2.1  /  Installation  /  Installing MySQL Router from Source Code

2.4 Installing MySQL Router from Source Code

The MySQL Router is written using the C++11 standard. As such, you must compile the code before you can install it. Compilation is typical of most C++ applications, as demonstrated below.

The CMake program provides control over how you configure a MySQL Router source distribution. Typically, you do this using options on the CMake command line. For information about options supported by CMake, run either of these commands in the top-level MySQL Router source directory:

shell> cmake . -LH
shell> ccmake .

The default CMake installation prefixes are used. It is different for each platform, but for most Unix-like platforms it is "/usr/local". It is possible to alter the installation path with the CMake variable "CMAKE_INSTALL_PREFIX". For example:

shell> mkdir build && cd build
shell> cmake .. -DINSTALL_LAYOUT=STANDALONE -DCMAKE_INSTALL_PREFIX=/opt/mysql/router2.1

Notice we use the -DINSTALL_LAYOUT=STANDALONE option to use the same installation layout as used for .tar.gz and .zip packages. This is the recommended setting for building the source.

Note

The CMake options are not documented here, but they are similar to the MySQL Server CMake options. For additional (related) information, see MySQL Source-Configuration Options.

Download and unpack the source files, and then follow the steps specific to your platform.

Linux and macOS

shell> tar xzf mysql-router-2.1.3-src.tar.gz
shell> cd mysql-router-2.1.3-src

Once this is complete, you need to configure and compile MySQL Router using cmake. Our examples use the default installation location of /usr/local.

Note

Installing MySQL Router generates a file named install_manifest.txt that lists all files (with paths) that were installed on the system. This file is useful for uninstalling MySQL Router.

However, there are a couple of things that you need to do in order to prepare your system for compiling the source code.


User Comments
Sign Up Login You must be logged in to post a comment.