When outputting a string from the database containing "Hello" to the console, abracadabra is displayed.
... var mysql= require('mysql'); var connectionmysql = mysql.createConnection({ host : 'localhost', user : 'user', password : 'password', database : 'database' }); connectionmysql.connect(); connectionmysql.query('SELECT * FROM dopuslugi WHERE id=?',[msg.id], function(err, rows, fields) { console.log(rows[0].name); }); Adding to mysql.createConnection charset: 'utf8' does not help, adding
connectionmysql.query("SET NAMES utf8"); connectionmysql.query("SET CHARACTER SET 'utf8'"); connectionmysql.query("SET SESSION collation_connection = 'utf8_general_ci'"); Does not help. Through PHP, this string is output without distortion.