Skip to content

A free open source IT asset/license management system

Make collation and charset for mysql an env variable

snipe5e1df7049c44
diff --git a/.env.example b/.env.example
index cd22ea38ea..9bc90e5ed2 100644
--- a/.env.example
+++ b/.env.example
@@ -19,6 +19,8 @@ DB_USERNAME=null
DB_PASSWORD=null
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
+DB_CHARSET=utf8mb4
+DB_COLLATION=utf8mb4_unicode_ci
# --------------------------------------------
# OPTIONAL: SSL DATABASE SETTINGS
diff --git a/config/database.php b/config/database.php
index 28a8c85be0..77c07f17f8 100755
--- a/config/database.php
+++ b/config/database.php
@@ -65,8 +65,8 @@ return [
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
- 'charset' => 'utf8mb4',
- 'collation' => 'utf8mb4_unicode_ci',
+ 'charset' => env('DB_CHARSET', 'utf8mb4'),
+ 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => env('DB_PREFIX', null),
'strict' => false,
'engine' => null,