Connection settings should accept 'collate' as a property
See original GitHub issueI’m using mysql2 with knex.
The default connection when using utf8mb4
seems to pick the first collate in the list (that being utf8mb4_0900_ai_ci
).
When I pass in utf8mb4_general_ci
as collate
property in connection settings for knex it gets passed down through mysql2 where it logs the following message:
Ignoring invalid configuration option passed to Connection: collate. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
But in order to have the knex_migrations
table use the correct collate when it intially created it needs to have the collate
option passed into it.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
SQL Server collation introduction with collate SQL casting
SQL Server collation indicates set of rules on how information can be stored, compared, and arranged in the T-SQL query statement.
Read more >Set or change the database collation - SQL Server
To change the collation of an existing database, requires ALTER permission on the database. Set or change the database collation using SSMS. In ......
Read more >Setting collation property in the connection string to SQL ...
This page lists all the properties you can set in the connection string for SQL Server. There's no such 'collation' property you can...
Read more >SQL Server Collation Settings and Processes
SSMS: Open properties by right clicking on properties. Once there, access the 'Options' tab. SQL Server Collation. Column Level. Collations ...
Read more >Deep Security Manager settings properties file
Used only with Microsoft SQL Server. Collation determines how strings are sorted and compared. If the value is "False", Deep Security will use ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK, appears to only happen when I’m using knex and mysql2 together. If I use mysql2 on its own the error does not appear. I stepped through the code and
getCharsetNumber
inconnection_config.js
thinking that was throwing an error.It appears to be a knex issue, its trying to create the knex_migrations table with
character set utf8mb4_general_ci
when it should becharacter set utf8m4 collate utf8mb4_general_ci
.Thank you, feel free to close the issue as it does not relate to mysql2.
My understanding is that whatever you put into knex client connection settings will get passed down to mysql2 connection settings
I tested it using
utf8mb4_general_ci
and am getting an error:Unknown character set: 'utf8mb4_general_ci'
I believe this is because
utf8mb4
is a character set whileutf8mb4_general_ci
is a collation.