项目场景:
VMware虚拟机安装Centos 部署SpringBoot项目,想连接windons数据库
问题描述:
提示:报错提示
Caused by: java.sql.SQLException: null, message from server: “Host ‘DESKTOP-FU6LT4I’ is not allowed to connect to this MySQL server”
原因分析:
本地Windows安装mysql 没有开发权限,导致无法访问 。
解决方案:
use mysql;
SELECT user,host FROM user;
# 开放权限
update user set host = "%" where user = "root" ;
# 刷新配置
flush privileges;
- 如图
虚拟机mysql服务连接windows中Mysql项目场景:问题描述:原因分析:解决方案: