MySQL Database Setup

✨ Feature

Germain supports MySQL as its datastore, providing users with a reliable and scalable solution for managing their data. In particular, MySQL Cluster is a powerful option that addresses the challenges of modern web, cloud, and communications services. MySQL Cluster offers the following benefits:

Benefit

Details

Scalability

MySQL Cluster allows you to scale your database horizontally by distributing the data across multiple nodes. This enables you to handle increasing data volumes and user traffic while maintaining high performance.

High Availability

With MySQL Cluster, your data is automatically replicated across multiple nodes, ensuring that it remains available even in the event of node failures. This high availability feature minimizes downtime and provides continuous access to your data.

Performance

MySQL Cluster is designed for high-performance applications. It leverages in-memory storage and parallel processing to deliver fast response times, making it suitable for demanding workloads and real-time applications.

Fault Tolerance

MySQL Cluster provides built-in fault tolerance mechanisms to protect your data. It can automatically detect and recover from node failures, ensuring data integrity and minimizing the impact on your applications.

Flexibility

MySQL Cluster supports a wide range of data types and indexing options, allowing you to model and query your data in a way that suits your application requirements. It also supports SQL, making it compatible with existing applications and tools.

By choosing MySQL Cluster as the datastore for Germain, you can leverage its capabilities to handle large amounts of data, deliver high availability, ensure performance, and achieve fault tolerance. This enables you to build robust and scalable applications that meet the needs of your business.

🚀 Deployment

Use version or higher.

🐧 Linux

Step

Command / Note

Update package lists

sudo apt update

Install MySQL server

sudo apt install mysql-server

Check MySQL service status

sudo systemctl status mysql

Download specific .deb if needed

If a specific version needs to be installed download .deb package from https://downloads.mysql.com/archives/community/

Install downloaded package

Then run dpkg -i <package_name>

It should show the status as running. Then you can connect to MySQL from command line using mysql -u root (password root)

🦁 Centos/RHEL

Step

Command / Note

Update packages

sudo yum update

Install wget

sudo yum install wget

Download MySQL repo RPM

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

Install the repo RPM

sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm

Install MySQL server

sudo yum install mysql-server

Start MySQL service

sudo systemctl start mysqld

It should show the status as running. Then you can connect to MySQL from command line using mysql -u root (password root)

🖥️ Windows

  • Download MySQL Installer from https://dev.mysql.com/downloads/installer/  and execute it

  • Choose the appropriate setup type (typically Developer Default) to install MySQL server and choose MySQL Workbench from development tools

  • Complete the installation wizard

You can then download https://www.mysql.com/products/workbench/ to connect to MySQL.

⚙️ Configuration

 Once you have MySQL you can run the SQL scripts which will generate the required schemas and tables.

Task

Details

Extract release

Extract Germain Service release file (to be referred to as $SERVICE_HOME)

Open readme

Open "$SERVICE_HOME/install/databases/readme.txt"

Change directory

Go to "$SERVICE_HOME/install/databases/mysql"

Edit basic setup

Edit "$SERVICE_HOME/install/databases/mysql/basic-setup.sql" Please update passwords where you see "identified by 'apm_datamart'" or "identified by 'apm_config'" accordingly

Execute scripts

Execute the SQL scripts one at a time in sequence specified in "$SERVICE_HOME/install/databases/readme.txt"

Run basic-setup.sql

Run basic-setup.sql – This will create 2 databases as apm_config and apm_datamart with its users as apm_config/apm_config and apm_datamart/apm_datamart

Run config scripts

Run config-*.sql by selecting the apm_config database (refer screenshot on Selecting DB below)

Run datamart scripts

Run datamart-*.sql by selecting the apm_datamart database (refer to screenshot on Selecting DB Below)