java.sql.SQLException: null, message from server: "Host 'PC-20220124VASY' is not allowed to connect to this MySQL server"
以上报错信息为,当前登录的mysql账号没有访问权。只能使用'localhost'或'127.0.0.1'访问,使用本地电脑的IP地址也是不可以访问的。
解决思路:
修改当前登录的mysql账号的访问权限
#登录mysql
mysql -u账号 -p密码
#登录成功之后进入mysql数据库
use mysql
#查询user表
select user,host from user;
#修改当前root账号的访问权限
update user set host='%' where user='root';
#刷新
flush privileges;
#再次查询
select user,host from user;
经过以上的操作,再次启动项目这个问题就解决了!