Create MariaDB servers
This chapter presents the MariaDB server creation script “mcreate.sh”
"mcreate.sh” performs all creation MariaDB Server creation steps and furthermore.
Creation of the admin and data directories
Creation of the MYSQL_SERVER based on mysql_install_db (official MySQL script)
Starting with MySQL 5.7 the new script “mysqld” is used with
the option “—initializer-insecure” in order to freely set the root password
Creation of the schema multi_admin (script mysqld_multi)
Creation of the MariaDB client option file ($MYSQL_BASE/admin/$MYSQL_SERVER/.my.cnf)
Extension of the MariaDB server option file ($MYSQL_CNF – etc/my.cnf)
Secure MYSQL_SERVER based on mysql_secure_installation (official MySQL script)
Automatic port matching with the MYSQL_SERVER digit (see response file)
The execution of "mcreate.sh” requires a configuration file and a response file. The configuration file contains administrative information (users, password, directories) and the response file contains server specific information (all information required for the MYSQL_SERVER in the MariaDB server option file).
Parameters
–h or –help
Display the Synopsis.
–s or –-sid
The MYSQL_SERVER name you wish to create. This parameter is always required:
Two options can be used for mcreate.sh script:
Format mysqldX or only a number X: X is a number between 1 and 9, corresponding to the port 3300X.
e.g.: “mysqld4” or “4” are equivalent
Custom name: it will create the instance in the first slot available founded.
e.g., “master-vmoraoel05”
It will add a line to the $DMK_HOME/etc/instance.cnf file:
–c or --configfile
The dbi services best practice consists of saving the configuration file under $DMK_HOME/etc which makes the command-line parameter “ConfigFile” useless.
Otherwise, the command-line parameter becomes mandatory
An option is to create a symbolic link of the response file you want to use from $DMK_HOME/templates/mcreate.rsp_version under $DMK_HOME/etc
Here is used the response file for MariaDB 10.7:
For simplicity, the parameter -r | --release can also be used, which auto create/update the symbolic link.
r or –release
A specific version of MariaDB can be used, several method can be used. It will automatically create or update a symbolic link of the response file you want to use from $DMK_HOME/templates/mcreate.rsp_version under $DMK_HOME/etc
e.g. with MariaDB 10.7 with different ways to use it:
It will create a symbolic link for the asked release if every followed conditions are validated:
The MariaDB source of this release is present in the system
The response file exists in $DMK_HOME/templates/mcreate.rsp_version directory respecting the format: mcreate.rsp_v[VERSION]
e.g. for MariaDB 11.x: the response file and symbolic link have to be created and adapted:
Configuration file
The configuration file contains the following parameters:
Response file
Last updated