node-mysql2
node-mysql2 copied to clipboard
How to set another collation (utf8mb4_unicode_ci)?
Hi! I have a database with next settings
CREATE DATABASE catabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
When i send cyrillic symbols ('привет') thru my app, i get '???????' on database GUI, and when i get data thru app, i get something like 'Суперадмин' И tried this
const pool = require('mysql2/promise').createPool({
...
charset: 'utf8mb4',
...
})
and this ones: charset: 'utf8mb4_unicode_ci', charset: 'UTF8MB4_UNICODE_CI', charset: 'UTF8MB4',
any update?
hi @Hellek @akoidan sorry for not getting back. Can you help by providing one single script that does all the setup and assertions ( create a schema, insert data, read back ) ? If the bug can't be reproduced by creating/inserting data from js maybe a shell script that calls mysql cli. That would help me get to the point where I can debug the issue much quicker
Also please specify a mysql server version you are using ( ideally a docker image name )