Ubuntu 22.04 and nodejs v16.14.0 + mysql does not get encoding
encoding was utf8_general_ci and now utf8mb3_general_ci
script to check:
[https://github.com/amir248/nodejs/blob/main/app.js](https://www.stackoverflow.com/)
utf_general_ci used to be the same and is on the server, now with ubuntu 22.04 utfmb4_general_ci encoding on the home machine to add and check on the home machine.
how to solve encoding problem?
`code: 'ER_BAD_FIELD_ERROR',
errno: 1054
sqlState: '42S22',
sqlMessage: "Unknown column 'Name' in 'field list'",`
Pass numbers to write them to database is obtained with npm mysql2 on ubuntu 22.04 and nodejs 16.14.0
But as soon as I try to pass any alphabetic characters, an error occurs
`sqlMessage: "Unknown column 'новое слово' in 'field list'"`我试图在设置中设置编码,但只需更改文件/etc/mysql/my.cnf,就会发生另一个错误,没有工作。
我在互联网上搜索了如何更改编码,但似乎编码应该与utf8_general_ci和utf8mb4_general_ci一起工作。
要更改配置文件,会发生错误,而且mysql根本无法工作。必须有一种行之有效的方法。
编辑文件/etc/mysql/my.cnf会导致一个新的错误,它也不是那么容易找出,所以我返回了所有的东西,谁知道原因是什么,在哪里查找?

问题是无法将mysql和节点js 16.14.0连接起来,从而使它们在ubuntu22.04上工作。
https://stackoverflow.com/questions/74506949
复制相似问题