orm
orm copied to clipboard
Add parameter "charset" for connection
Now for set charset need use so configuration:
'connections' => [
'mysql' => [
'connection' => 'mysql:host=localhost;dbname=xxx;charset=utf8mb4',
'username' => 'root',
'password' => 'root',
'options' => [
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES "utf8mb4"',
],
]
]
I suggest add parameter charset
that will be added to connection (if need) and used in init command:
'connections' => [
'mysql' => [
'connection' => 'mysql:host=localhost;dbname=xxx',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8mb4',
]
]
For MySQL together with SET NAMES
, maybe need use SET character_set_client=...
, SET character_set_connection=...
, SET character_set_results=...
. But I'm not sure.