Yep, i tried it before. It doesn’t work. The error print out from VPS.
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
I did grant all permission for the database to the user, and re-do again following your command. This is a quick test in my DO. user: ‘selfpaths’ is going to hit does not support authentication. It only work in ‘user: root’;
var mysql = require("mysql");
var con = mysql.createConnection({
host: "localhost",
user: "selfpaths",
password: "somePass",
database: "TestDatabase",
});
con.connect(function (err) {
if (err) throw err;
//Select all customers and return the result object:
con.query("SELECT * FROM users", function (err, result, fields) {
if (err) throw err;
console.log(result);
});
});
This is the output for grant permission
mysql> show grants for 'selfpaths'@'localhost';
+-----------------------------------------------------------------------+
| Grants for selfpaths@localhost |
+-----------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `selfpaths`@`localhost` |
| GRANT ALL PRIVILEGES ON `TestDatabase`.* TO `selfpaths`@`localhost` |
| GRANT ALL PRIVILEGES ON `boilerplateEco`.* TO `selfpaths`@`localhost` |
+-----------------------------------------------------------------------+
3 rows in set (0.00 sec)