S
S
ski282019-05-20 14:27:12
MySQL
ski28, 2019-05-20 14:27:12

NodeJS + Mysql how to set encoding?

Good afternoon. NodeJS and Mysql writes krakozyabry.
Settings

var connection = mysql.createConnection({
  charset: "utf8_general_ci",
  host: config.mysql.host,
  user: config.mysql.user,
  password: config.mysql.password,
  database: config.mysql.database
});

Request
mysql.query("INSERT INTO `user` (`firstname`) VALUES ('ТУТ ТЕКСТ НА РУССКОМ')");

Result
"впивпвап "
Table encoding
utf8_general_ci

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ski28, 2019-05-20
@ski28

The issue was resolved, created a clean database. In phpMyAdmin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question