mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 23:26:27 +03:00
Specify charset when using MySQL (#1059)
Because of backward-compatibility reasons, not specifying the charset will result in "utf8" being used, which is a deprecated charset. Also, when the charset for creating tables is not specified, the one specified in the DSN is reused if specified. In the future, DBAL is going to drop default values, which means we will have to specify a charset anyway.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
"#2": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
|
||||
"#3": "",
|
||||
"#4": "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"",
|
||||
"#5": "DATABASE_URL=\"mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7\"",
|
||||
"#5": "DATABASE_URL=\"mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7&charset=utf8mb4\"",
|
||||
"DATABASE_URL": "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
|
||||
},
|
||||
"dockerfile": [
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"#2": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
|
||||
"#3": "",
|
||||
"#4": "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"",
|
||||
"#5": "DATABASE_URL=\"mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7\"",
|
||||
"#5": "DATABASE_URL=\"mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7&charset=utf8mb4\"",
|
||||
"DATABASE_URL": "postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8"
|
||||
},
|
||||
"dockerfile": [
|
||||
|
||||
Reference in New Issue
Block a user