Skip to content

Commit f417ab2

Browse files
authored
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.
1 parent fadeac1 commit f417ab2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doctrine/doctrine-bundle/2.3/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"#2": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
1212
"#3": "",
1313
"#4": "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"",
14-
"#5": "DATABASE_URL=\"mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7\"",
14+
"#5": "DATABASE_URL=\"mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7&charset=utf8mb4\"",
1515
"DATABASE_URL": "postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
1616
},
1717
"dockerfile": [

doctrine/doctrine-bundle/2.4/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"#2": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
1212
"#3": "",
1313
"#4": "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"",
14-
"#5": "DATABASE_URL=\"mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7\"",
14+
"#5": "DATABASE_URL=\"mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7&charset=utf8mb4\"",
1515
"DATABASE_URL": "postgresql://symfony:[email protected]:5432/app?serverVersion=13&charset=utf8"
1616
},
1717
"dockerfile": [

0 commit comments

Comments
 (0)