Creating a MySQL database for JumpServer
By default, MySQL and Redis, necessary for JumpServer operation, are created on the same server within containers, but often it's necessary to set up MySQL on a separate server (for example, when configuring a JumpServer cluster).
Instead of a single MySQL instance in a production environment, it's recommended to use a MySQL HA-cluster. You can find instructions on how to create a MySQL cluster in the MySQL documentation.
Installing MySQL:
# apt-get install mysql-server
Creating the MySQL database: Access the mysql command line (with elevated privileges sudo su\root) and create the database.
# mysql
> create database jumpserver default charset 'utf8';
Check the created database using the command:
> show create database jumpserver;
You should see the output:
+------------+---------------------------------------------------------------------+
| Database | Create Database |
+------------+---------------------------------------------------------------------+
| jumpserver | CREATE DATABASE `jumpserver` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+------------+---------------------------------------------------------------------+
1 row in set (0.00 sec)
Create a separate user for JumpServer, set a password (KXOeyNgDeTdpeu9q), and grant the necessary privileges:
mysql> create user 'jumpserver'@'%' identified by 'KXOeyNgDeTdpeu9q';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on jumpserver.* to 'jumpserver'@'%';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Comments