远程连接数据库报错1045(完美解决)

解决用navicate远程连接数据库出现1045 access denied for user ‘root’@‘localhost’ using password yes
在mysql命令行中执行
SET PASSWORD FOR ‘root’@‘localhost’ = PASSWORD(‘123456’);
GRANT ALL PRIVILEGES ON . TO ‘root’ @’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
flush privileges;

若以上方法行不通则用:
use mysql;
UPDATE user SET Password=PASSWORD(‘123456’) where USER=‘root’;
flush privileges;


获取更多 请扫码关注公众号哦~

感谢各位姥爷的点赞阅读~

远程连接数据库报错1045(完美解决)_第1张图片

你可能感兴趣的:(java,mysql)