How To Install mysql-router on Ubuntu 20.04

In this tutorial we learn how to install mysql-router on Ubuntu 20.04. mysql-router is route connections from MySQL clients to MySQL servers route connections from MySQL clients to MySQL servers

Introduction

In this tutorial we learn how to install mysql-router on Ubuntu 20.04.

What is mysql-router

mysql-router is:

MySQL Router is part of InnoDB cluster, and is lightweight middleware that provides transparent routing between your application and back-end MySQL servers. It can be used for a wide variety of use cases, such as providing high availability and scalability by effectively routing database traffic to appropriate back-end MySQL servers. The pluggable architecture also enables developers to extend MySQL Router for custom use cases.

Since MySQL Router is clustering software and needs to be configured and managed across an entire cluster, packaging cannot manage it for you. This package supplies the binary build only, ready for manual configuration.

Package: mysql-router Architecture: amd64 Version: 8.0.19-0ubuntu5 Priority: optional Section: universe/database Source: mysql-8.0 Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian MySQL Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 12463 Depends: libc6 (>= 2.28), libevent-core-2.1-7 (>= 2.1.8-stable), libevent-extra-2.1-7 (>= 2.1.8-stable), libevent-openssl-2.1-7 (>= 2.1.8-stable), libgcc-s1 (>= 3.0), liblz4-1 (>= 0.0~r127), libssl1.1 (>= 1.1.1), libstdc++6 (>= 9), zlib1g (>= 1:1.1.4) Filename: pool/universe/m/mysql-8.0/mysql-router_8.0.19-0ubuntu5_amd64.deb Size: 2499180 MD5sum: a48b5ca3e63d1a2094209d98eec867d7 SHA1: ea6d3aaaaa499660385be7902bdfa0f8c6e7e197 SHA256: feaf43fbc6a3ca260b17be7fb5d2c94da5968fc83cfc5859e4322cc8a0cf068c Homepage: https://dev.mysql.com/doc/mysql-router/8.0/en/ Description-en: route connections from MySQL clients to MySQL servers MySQL Router is part of InnoDB cluster, and is lightweight middleware that provides transparent routing between your application and back-end MySQL servers. It can be used for a wide variety of use cases, such as providing high availability and scalability by effectively routing database traffic to appropriate back-end MySQL servers. The pluggable architecture also enables developers to extend MySQL Router for custom use cases.

Since MySQL Router is clustering software and needs to be configured and managed across an entire cluster, packaging cannot manage it for you. This package supplies the binary build only, ready for manual configuration.

There are three methods to install mysql-router on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install mysql-router Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install mysql-router using apt-get by running the following command:

sudo apt-get -y install mysql-router

Install mysql-router Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install mysql-router using apt by running the following command:

sudo apt -y install mysql-router

Install mysql-router Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install mysql-router using aptitude by running the following command:

sudo aptitude -y install mysql-router

How To Uninstall mysql-router on Ubuntu 20.04

To uninstall only the mysql-router package we can use the following command:

sudo apt-get remove mysql-router

Uninstall mysql-router And Its Dependencies

To uninstall mysql-router and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove mysql-router

Remove mysql-router Configurations and Data

To remove mysql-router configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge mysql-router

Remove mysql-router configuration, data, and all of its dependencies

We can use the following command to remove mysql-router configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge mysql-router

References

Summary

In this tutorial we learn how to install mysql-router package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.