Skip to content

Database Configuration

This page provides comprehensive database configuration information for Mideye Server 6. For database overview, encryption, and shared database information, see Database Overview.

For supported databases, see Database Overview - Supported Databases.


Configuration File Locations

Configuration file locations

  • Windows: C:\Program Files (x86)\Mideye Server 6\config\application-prod.yml
  • Linux: /opt/mideyeserver6/config/application-prod.yml

Database Configuration Examples

MSSQL Database Configuration

For Microsoft SQL Server databases, use the following configuration:

spring:
    devtools:
        restart:
            enabled: false
        livereload:
            enabled: false
    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
        url: jdbc:sqlserver://localhost:1433;databaseName=MideyeServer_DB;authenticationScheme=NTLM;useNTLMv2=true;user=PLACEHOLDER_DO_NOT_CHANGE_OR_REMOVE;password=PLACEHOLDER_DO_NOT_CHANGE_OR_REMOVE
        username: mideye
        password: password
        hikari:
            connection-test-query: SELECT 1
            initializationFailTimeout: 3600000
            data-source-properties:
                cachePrepStmts: true
                prepStmtCacheSize: 250
                prepStmtCacheSqlLimit: 2048
                useServerPrepStmts: true
    jpa:
        database-platform: org.hibernate.dialect.SQLServer2012Dialect
        database: SQL_SERVER
        show-sql: false
        properties:
            hibernate.id.new_generator_mappings: true
            hibernate.cache.use_second_level_cache: false
            hibernate.cache.use_query_cache: false
            hibernate.generate_statistics: false
    liquibase:
        contexts: prod

MSSQL Quick Database Creation

sqlcmd -Q "CREATE DATABASE MideyeServer_DB"

MySQL/MariaDB Database Configuration

For MySQL or MariaDB databases, use the following configuration:

spring:
    devtools:
        restart:
            enabled: false
        livereload:
            enabled: false
    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: jdbc:mariadb://localhost:3306/MideyeServer_DB?sslMode=TRUST
        username: mideye
        password: user_password
        hikari:
            initializationFailTimeout: 3600000
            data-source-properties:
                cachePrepStmts: true
                prepStmtCacheSize: 250
                prepStmtCacheSqlLimit: 2048
                useServerPrepStmts: true
                max-lifetime: 600000
    jpa:
        database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
        database: MYSQL
        show-sql: false
        properties:
            hibernate.id.new_generator_mappings: true
            hibernate.cache.use_second_level_cache: true
            hibernate.cache.use_query_cache: false
            hibernate.generate_statistics: false
            hibernate.cache.region.factory_class: io.github.jhipster.config.jcache.BeanClassLoaderAwareJCacheRegionFactory
    liquibase:
        contexts: prod

MySQL 8 SSL Configuration

MySQL 8 enforces SSL connections by default. If you encounter SSL-related connection issues, add ?sslMode=TRUST to the database URL as shown in the example above.

MySQL/MariaDB Database Creation Commands

CREATE DATABASE MideyeServer_DB CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'mideye'@'localhost' IDENTIFIED BY 'user_password';
GRANT ALL PRIVILEGES ON MideyeServer_DB.* TO 'mideye'@'localhost';
FLUSH PRIVILEGES;

Manual Configuration Steps

1. Stop Mideye Server Service

Linux:

systemctl stop mideyeserver6

Windows:

Stop-Service "Mideye Server 6"

2. Edit Configuration File

Open the application-prod.yml file with a text editor:

Linux:

sudo vim /opt/mideyeserver6/config/application-prod.yml

Windows: Open as Administrator: C:\Program Files (x86)\Mideye Server 6\config\application-prod.yml

3. Update Database Configuration

Navigate to the datasource section and update the configuration according to your database type using the examples above.

Important Notes

  • Syntax is critical in YAML files - incorrect indentation will prevent the server from starting
  • Database passwords must be enclosed in single quotes (') in the YAML file
  • If your password contains single quotes, escape them by using two single quotes ('') for each single quote

4. Start Mideye Server Service

Linux:

systemctl start mideyeserver6

Windows:

Start-Service "Mideye Server 6"


Changing Database Type

To change from one database type to another:

  1. Backup your current database and configuration
  2. Install and configure the new database
  3. Update the application-prod.yml file with the new database configuration
  4. Restart the Mideye Server service

For detailed migration instructions (e.g., MySQL to MSSQL), see Migrating from MySQL to MSSQL.


Connection String Examples

MSSQL Connection Strings

Standard Connection:

jdbc:sqlserver://localhost:1433;databaseName=MideyeServer_DB

With Domain Authentication:

jdbc:sqlserver://localhost:1433;databaseName=MideyeServer_DB;authenticationScheme=NTLM;useNTLMv2=true

With SSL Trust Certificate (MSSQL 2022+):

jdbc:sqlserver://localhost:1433;databaseName=MideyeServer_DB;trustServerCertificate=true

MySQL/MariaDB Connection Strings

Standard Connection:

jdbc:mariadb://localhost:3306/MideyeServer_DB

With SSL Trust (MySQL 8+):

jdbc:mariadb://localhost:3306/MideyeServer_DB?sslMode=TRUST

Remote Database:

jdbc:mariadb://192.168.1.100:3306/MideyeServer_DB?sslMode=TRUST


Troubleshooting

Common Configuration Errors

Server not starting after configuration change:

  1. Check YAML syntax - ensure proper indentation
  2. Verify database connectivity
  3. Check database credentials
  4. Review server logs

Database connection timeout:

  • Increase initializationFailTimeout value (default: 3600000ms)
  • For faster debugging, temporarily set to 10000ms (10 seconds)
hikari:
    initializationFailTimeout: 10000

MySQL 8 SSL Connection Issues:

Add ?sslMode=TRUST to the database URL:

url: jdbc:mariadb://localhost:3306/MideyeServer_DB?sslMode=TRUST

MSSQL 2022 Certificate Issues:

Add ;trustServerCertificate=true to the database URL:

url: jdbc:sqlserver://localhost:1433;databaseName=MideyeServer_DB;trustServerCertificate=true

Log File Locations

Linux: /opt/mideyeserver6/log/ Windows: C:\Program Files (x86)\Mideye Server 6\log\


Additional Resources