天天看點

虛拟機mysql服務連接配接windows中Mysql項目場景:問題描述:原因分析:解決方案:

項目場景:

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項目場景:問題描述:原因分析:解決方案: