出现如题错误可能原因:
1、密码有误。检查密码是否与 mysql.user 中 root 用户对应密码一致(我就是这个原因,被折磨整个下午和晚上)
2、用户 root 没有授权,授权命令如下:
grant all on *.* to root@'%' identified by 'password';
flush privileges;
3、数据库端口被墙了。关闭防火墙或者添加端口特例