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'"`
I tried to set the encoding in the settings, but just change the file /etc/mysql/my.cnf another error occurs and nothing works.
I searched all over the Internet how to change the encoding, but it seems that the encoding should work with utf8_general_ci along with utf8mb4_general_ci
to change configuration files an error occurs and mysql does not work at all. there needs to be a proven way.
edit file /etc/mysql/my.cnf
causes a new error, it’s also not so easy to figure it out, so I returned everything back, can anyone know what could be the reason and where to look?
the problem is that it is not possible to connect mysql and node js 16.14.0 so that they work on ubuntu 22.04
Name
which doesn't exist in your database table...