我是新手使用node.js和mysql,我有一个简单的脚本,使用节点登录到mysql服务器。
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : ''
});
connection.connect(function(err)
{
if (!err)
console.log('Connected');
else
console.log('Error connection');
console.log(err);
});
当我的xampp mysql服务器运行时,它返回connected,但是当xampp被关闭并且mysql服务器通知程序正在运行时,它返回这个错误。
“代码:'ER_ not _SUPPORTED_AUTH_MODE',错误号: 1251,sqlMessage:‘客户端不支持服务器请求的身份验证协议;请考虑升级MySQL客户端’,sqlState:'08004',fatal: true }”我使用了mysql站点上的windows安装程序。我运行的是Windows10,它直接安装在我电脑的C盘上。
发布于 2018-06-01 16:25:19
您是否可以通过执行以下命令进行尝试:
use mysql;
update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';
发布于 2018-06-04 02:55:17
如果您运行的是MySQL 8.0,那么您可能面临着与here相同的问题(并且能够使用相同的解决方案来解决它)。
https://stackoverflow.com/questions/50638715
复制相似问题