Nodejs writes Chinese to mysql to report errors

  node.js, question

First, nodejs wrote a small crawler, climbed down a little bit of data, and then wanted to write it into the database.
Nodejs code:

Sql = "insert into "plus table plus" values ("plus maxCol plus", "plus data[i].url plus"',' "plus data[i].name plus"');
 connection.query(sql, function(err, results, fields){
 !  err ?   console.log("success!  !  !"  ) : console.log(err);

After writing to the database, select * from table in the database; The place that should be Chinese is always a question mark:


The database character set is as follows:


So could it be my nodejs or the mysql module that require came in? Solve!

It is mysql’s output problem at the terminal. You can read the data with node’s mysql module to know whether the data is normal.
Or you can specify the character set when calling mysql
mysql –default-character-set=utf8