Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql编码错误_Mysql_Node.js_Utf 8_Character Encoding - Fatal编程技术网

Mysql编码错误

Mysql编码错误,mysql,node.js,utf-8,character-encoding,Mysql,Node.js,Utf 8,Character Encoding,我正试图使用驱动程序从节点在mysql中插入一行,但出现以下错误: running query \"INSERT INTO outgo (name, monthIdMonth, type, distribution, recurrent, amount) VALUES ('Penalizări', (select MAX(idMonth) from `month`), '3', '1', '1', '0');\" failed: Error: Incorrect string value: '\

我正试图使用驱动程序从节点在mysql中插入一行,但出现以下错误:

running query \"INSERT INTO outgo (name, monthIdMonth, type, distribution, recurrent, amount) VALUES ('Penalizări', (select MAX(idMonth) from `month`), '3', '1', '1', '0');\"
failed: Error: Incorrect string value: '\\xC4\\x83ri' for column 'name' at row 1
outgo表的创建方式如下:

创建表(如果不存在)`outgo`(
`idOutgo`INT无符号非空自动增量,
`name`VARCHAR(50)不为空,
`apartmentsGroupIdApartmentsGroup`INT UNSIGNED NULL,
`outgoColumnInfoIdOutgoColumn`INT无符号NULL,
`计量'ENUM'('NONE'、'COLD_WATER'、'HOT_WATER'、'OTHER')空,
`分布'ENUM'('MANUAL'、'PERSON'、'plant'、'SURFACE'、'consumpion'、'AUTOMATED'、'HEAT_SURFACE')NULL,
`金额`双倍(14,2)空,
`cAmount`DOUBLE(14,2)NULL,
`costPerUnit`DOUBLE(15,3)NULL,
`单位'VARCHAR(5)空,
`数量`双(14,2)空,
`Diff`双(14,4)空,
`经常性'TINYINT(1)不为空默认值0,
`monthIdMonth`INT无符号非空,
`类型“ENUM('GENERAL'、'REMAINING'、'PENALITY')不为NULL默认值为“GENERAL”,
`billIdBill`INT无符号NULL,

ENGINE=InnoDB;
因此,最终我找到了解决方案:我在节点连接中添加了一个字符集参数:

var pool  = mysql.createPool({
    host     : config.get.mysql.host,
    port     : config.get.mysql.port,
    user     : config.get.mysql.username,
    password : config.get.mysql.password,
    database : 'general',
    connectionLimit : 50,
    queueLimit : 5000,
    charset: "utf8_general_ci"
});

显示
outgo
Show CREATE TABLE
。连接编码是什么?我没有指定连接编码。我如何才能找到?是什么“区域设置”linux上的命令返回?您能显示用于插入行的代码吗?可能的重复项您是否尝试使用
ă
?其utf8十六进制为C483。猜测:您没有指定