连接mysql报错1251解决方案

首先登陆mysql数据库,改变加密方式

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.10 sec)

更改用户密码这里以root为例

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Query OK, 0 rows affected (0.35 sec)

刷新,成功了

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.28 sec)

你可能感兴趣的:(JavaEE)