> ## Documentation Index
> Fetch the complete documentation index at: https://docs.germainux.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL Database Setup

> GermainUX supports MySQL as an on-premise datastore.

Service
`Enterprise`

Availability
2024.1

> [card] [Install MySQL](#install-mysql)
>
> Using an approved distribution

> [card] [Secure MySQL](#secure-mysql)
>
> Hardening before database setup

> [card] [Create the GermainUX Databases](#create-the-germainux-databases)
>
> Two databases and init scripts

> [card] [Production Checklist](#production-checklist)
>
> Contact support before launch

### Overview

GermainUX supports MySQL as an on-premise datastore.

MySQL may be appropriate when:

* Your organization already operates MySQL.
* Database administrators have established MySQL backup, security, and monitoring procedures.
* A relational datastore is required.
* The expected GermainUX ingestion and analytics workload has been validated against MySQL.

Elasticsearch remains the preferred datastore for new, high-volume GermainUX deployments. Before selecting MySQL, review the [Datastore Recommendation and Benchmark](https://docs.germainux.com/main/datastore-which-to-choose.md).

### MySQL Deployment Options

GermainUX can use a standard MySQL deployment or a highly available MySQL architecture approved by your organization.

A clustered architecture can provide:

| Capability | Benefit |
| - | - |
| Horizontal scalability | Distributes workload and data across multiple nodes |
| High availability | Maintains service when an individual node fails |
| Replication | Provides redundant copies of data |
| Fault tolerance | Reduces the effect of infrastructure failures |
| Performance | Supports higher ingestion and query workloads when properly configured |

The appropriate architecture depends on data volume, retention, availability requirements, and internal MySQL standards.

### Before You Begin

Confirm with Germain Software:

* The MySQL version supported by your GermainUX release
* Required JDBC driver version
* Character set and collation
* Schema scripts required for the release
* Expected daily AA Unit volume
* Retention requirements

> [accordion] Show all 9
>
> * Storage and performance requirements
> * High-availability requirements
> * Upgrade or migration requirements

Do not install or upgrade MySQL independently of GermainUX compatibility requirements.

### Requirements

Prepare:

* A supported 64-bit operating system
* A supported MySQL Server version
* Administrative access to MySQL
* A supported MySQL JDBC driver
* Network connectivity from GermainUX Enterprise
* Sufficient CPU, memory, SSD storage, and IOPS

> [accordion] Show all 9
>
> * Backup and recovery procedures
> * TLS and authentication
> * The GermainUX Service distribution package

See:

| Topic | Link |
| - | - |
| Hardware Requirements | [Hardware Requirements](https://docs.germainux.com/main/hardware-requirements.md) |
| Network Requirements | [Network Requirements](https://docs.germainux.com/main/network-requirements.md) |
| Storage Requirements | [Storage Requirements](https://docs.germainux.com/main/storage-requirements.md) |

## Install MySQL

Use your organization’s approved MySQL distribution and installation process.

### Debian or Ubuntu

Update the package index and install MySQL Server:

```text theme={null}
sudo apt update
sudo apt install mysql-server
```

Confirm that the service is running:

```text theme={null}
sudo systemctl status mysql
```

Run the MySQL security configuration provided by the installed distribution and configure an administrative account according to your security policies.

If a specific MySQL version is required, obtain it from the [MySQL Community Downloads archive](https://downloads.mysql.com/archives/community/) or your approved internal repository.

### Red Hat Enterprise Linux or Compatible Distribution

Configure an approved MySQL repository for the operating-system version, then install and start MySQL Server using the system package manager.

Example:

```text theme={null}
sudo dnf install mysql-community-server
sudo systemctl enable --now mysqld
sudo systemctl status mysqld
```

Repository names and commands vary by operating-system and MySQL version. Use the current package provided for your distribution rather than an obsolete repository package.

### Windows

Download and install:

1. Download the [MySQL Installer for Windows](https://dev.mysql.com/downloads/installer/).
2. Run the installer with administrator privileges.
3. Select **Server Only** for a production database host, or **Custom** when additional tools are required.
4. Configure the MySQL service.
5. Configure the administrative account.
6. Enable TCP/IP connectivity.
7. Configure TLS.
8. Complete the installation.
9. Confirm that the MySQL Windows service is running.

Install [MySQL Workbench](https://www.mysql.com/products/workbench/) only when a graphical administration tool is required.

## Secure MySQL

Before creating the GermainUX databases:

* Remove anonymous users.
* Disable unnecessary remote administrative access.
* Do not use default or example passwords.
* Require strong, unique credentials.
* Enable TLS for GermainUX connections.
* Restrict access by host and network.

> [accordion] Show all 10
>
> * Apply least-privilege permissions.
> * Protect credentials outside source control.
> * Configure audit logging when required.
> * Define credential-rotation procedures.

Do not use the MySQL `root` account as the GermainUX runtime account.

## Create the GermainUX Databases

GermainUX uses two MySQL databases:

| Database | Purpose |
| - | - |
| `apm_config` | Stores GermainUX configuration |
| `apm_datamart` | Stores GermainUX monitoring and analytical data |

The release package includes the SQL scripts required to create and initialize these databases.

### 1 1. Extract the Service Distribution

Extract the GermainUX Service release package to a directory referenced below as:

```text theme={null}
$SERVICE_HOME
```

### 2 2. Review the Database Instructions

Open:

```text theme={null}
$SERVICE_HOME/install/databases/readme.txt
```

This file defines the scripts and execution order for the specific GermainUX release.

Always follow the instructions supplied with the release being installed.

### 3. Locate the MySQL Scripts

The MySQL scripts are located under:

```text theme={null}
$SERVICE_HOME/install/databases/mysql
```

### 4. Update the Initial Setup Script

Open:

```text theme={null}
$SERVICE_HOME/install/databases/mysql/basic-setup.sql
```

Replace the example passwords associated with:

```text theme={null}
apm_config
apm_datamart
```

Use strong, unique credentials approved by your organization.

Do not retain example credentials such as:

```text theme={null}
apm_config / apm_config
apm_datamart / apm_datamart
```

These values are placeholders only and must not be used in production.

### 5. Run `basic-setup.sql`

Execute:

```text theme={null}
basic-setup.sql
```

The script creates:

* `apm_config`
* `apm_datamart`
* The corresponding GermainUX database accounts and permissions

Review the script before execution to confirm that database names, users, hosts, and permissions match your architecture.

### 6. Initialize `apm_config`

Select:

```text theme={null}
apm_config
```

Run each:

```text theme={null}
config-*.sql
```

script in the sequence specified by:

```text theme={null}
$SERVICE_HOME/install/databases/readme.txt
```

### 7. Initialize `apm_datamart`

Select:

```text theme={null}
apm_datamart
```

Run each:

```text theme={null}
datamart-*.sql
```

script in the required sequence.

Do not skip scripts or change the order unless instructed by Germain Software.

## Configure GermainUX Enterprise

Configure GermainUX Enterprise with:

* MySQL hostname
* MySQL port
* `apm_config` database name
* `apm_datamart` database name
* Dedicated database usernames
* Securely stored passwords

> [accordion] Show all 10
>
> * TLS settings
> * Connection-pool settings
> * Query and connection timeouts
> * JDBC driver

The default MySQL port is commonly:

```text theme={null}
3306
```

Use the actual port configured in your environment.

Place the supported MySQL JDBC driver in the location specified by the GermainUX Enterprise installation guide.

## Validate the Setup

Before starting production monitoring:

**1. Connect to MySQL using each GermainUX service account**

**2. Confirm that both databases exist**

**3. Confirm that all required tables and indexes were created**

**4. Verify that GermainUX Enterprise can connect**

**5. Start GermainUX Enterprise**

**6. Review logs for schema or permission errors**

**7. Confirm that GermainUX configuration can be saved**

**8. Ingest a limited monitoring workload**

**9. Confirm that data is written to `apm_datamart`**

**10. Open representative dashboards and analyses**

**11. Test retention and cleanup**

**12. Measure query and ingestion performance**

## Backup and Recovery

Configure backups for both:

```text theme={null}
apm_config
apm_datamart
```

The backup strategy should include:

* Regular full backups
* Incremental or binary-log recovery where required
* Off-host backup storage
* Encryption
* Retention
* Monitoring of backup failures
* Periodic restore testing

The configuration and datamart databases may have different recovery and retention requirements.

## Performance and Capacity

Monitor:

* CPU and memory
* Disk capacity
* Disk latency and IOPS
* Connection count
* Buffer-pool utilization
* Query latency

> [accordion] Show all 11
>
> * Lock contention
> * Replication lag
> * Table and index growth
> * Backup duration
> * Slow queries

Reassess capacity when monitoring scope, Session Replay, data retention, or user volume increases.

## Production Checklist

* The MySQL version is supported by GermainUX.
* The required JDBC driver is installed.
* TLS is enabled.
* Administrative access is restricted.
* Dedicated GermainUX accounts are configured.
* Example passwords have been replaced.

> [accordion] Show all 14
>
> * `apm_config` has been initialized.
> * `apm_datamart` has been initialized.
> * All scripts ran in the documented sequence.
> * GermainUX Enterprise connects successfully.
> * Backups are configured.
> * A restore has been tested.
> * Capacity and performance monitoring are enabled.
> * High availability has been validated when required.

For supported versions, database scripts, migration assistance, or production sizing, contact Germain Software.

## Get Help

> [card] [Contact GermainUX Support](https://docs.germainux.com/main/support.md)
>
> The GermainUX team helps you get up and running faster, empower your team, turn data into actionable insights, and optimize performance to deliver measurable business outcomes.

> [card] Can't find what you need?
>
> Search all GermainUX docs with **Ctrl + K**, or use the feedback buttons at the bottom of this page to tell us what is missing.

The content of this document is proprietary to GERMAIN SOFTWARE.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.