Compiling and Using the MySQL Router Labs Release

Last week we released MySQL Router into our Labs and we need to provide a few extra details on how to actually use it.


  • A modern OS which comes with a compiler supporting C++11. For example, Ubuntu 14.04 and later, Oracle Linux 7, OS X 10.10. Oracle Linux 6 works as well, but you have to install the DevtoolSet 3 software collection.
  • MySQL Client Libraries development packages.
  • CMake 2.8.9 or later

You need also a few MySQL servers running to actually test Router. MySQL Fabric is not strictly required, but you would not be able to use Fabric Cache.


First, download the TAR or ZIP archive from and unpack it.

Configure and compile MySQL Router using CMake.  We are installing in the default location, /usr/local/:

Notice the file named install_manifest.txt, it is useful to uninstall.

Now you can do some basic tests:


Router looks in 2 locations by default for its configuration file:

  1. /etc/mysql/mysqlrouter.ini
  2. .mysqlrouter.ini in your $HOME directory.

You can see them when using the --help option.

You can also specify any custom locations using the -c /path/to/config_file.ini command line option.

Here’s a basic configuration showing Connection Routing using read-only and read-write modes.

A few notes about the above configuration file:

  • logging_folder has no value, this means that logging will go to the console. You can log to file when you specify a directory.
  • plugin_folder should use the installation prefix you have used with CMake


If all is well and you have your configuration file, you can start MySQL Router like this:

When you now connect with a MySQL Client, using the ports 7001 and 7002, you will get to the configured destinations servers.


Since this is a lab, there will be rough edges, so please report issues using and use our forums to start a discussion about MySQL Router. We appreciate your interest and feedback!

Leave a Reply

Your email address will not be published. Required fields are marked *

Please enter. * Time limit is exhausted. Please reload CAPTCHA.