首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nodejs v16 + mysql2在ubuntu 22.04中的误差

nodejs v16 + mysql2在ubuntu 22.04中的误差
EN

Stack Overflow用户
提问于 2022-11-20 09:30:34
回答 1查看 39关注 0票数 -2
代码语言:javascript
复制
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上工作。

EN

回答 1

Stack Overflow用户

发布于 2022-11-21 12:07:45

[

2]2

引号现在被感染了。是的。- do not work, '- ok. yes, it was in quotes -一个错误,如果他们的错误也消失了,但他们写下了数字。我试着把引号改成这些-瞧!赚来的!谢谢你的帮助,它是用引号表示的。

变量cause errors, so the error lies in the fact that the ' quote and引号的引号是相似的,但它们是不同的,它不是立即可见的,但是这里存在错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74506949

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档