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¶
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:
Windows:
2. Edit Configuration File¶
Open the application-prod.yml
file with a text editor:
Linux:
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:
Windows:
Changing Database Type¶
To change from one database type to another:
- Backup your current database and configuration
- Install and configure the new database
- Update the
application-prod.yml
file with the new database configuration - 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:
With Domain Authentication:
jdbc:sqlserver://localhost:1433;databaseName=MideyeServer_DB;authenticationScheme=NTLM;useNTLMv2=true
With SSL Trust Certificate (MSSQL 2022+):
MySQL/MariaDB Connection Strings¶
Standard Connection:
With SSL Trust (MySQL 8+):
Remote Database:
Troubleshooting¶
Common Configuration Errors¶
Server not starting after configuration change:
- Check YAML syntax - ensure proper indentation
- Verify database connectivity
- Check database credentials
- Review server logs
Database connection timeout:
- Increase
initializationFailTimeout
value (default: 3600000ms) - For faster debugging, temporarily set to 10000ms (10 seconds)
MySQL 8 SSL Connection Issues:
Add ?sslMode=TRUST
to the database URL:
MSSQL 2022 Certificate Issues:
Add ;trustServerCertificate=true
to the database URL:
Log File Locations¶
Linux: /opt/mideyeserver6/log/
Windows: C:\Program Files (x86)\Mideye Server 6\log\
Additional Resources¶
- Database Overview - Database information, encryption, and concepts
- Shared Database Configuration - Multi-server database setups
- Application Configuration - Complete application-prod.yml reference
- MySQL to MSSQL Migration - Database migration guide