2016年5月15日 星期日

nodejs post data to mariadb 中文字相容性問題

檢查mariadb是否為utf-8格式

 mysqladmin -u root -p var | grep -E 'character|collation' | tr -s ' '













nodejs 

var client = require('mariasql');

記得要加上charset :'utf8'


範例
=================================
var client = require('mariasql');

var c =new client({
host:'your ip or dns',
user:'root',
password:'your password',
db:'your database name',
charset :'utf8'

});

=================================


1 則留言:

  1. Thanks for the tip with "charset :'utf8'" (i do not know chinese languange, but the tip was helpful).

    回覆刪除

熱門文章