message from server: "Host 'DESKTOP-QIR7OV5' is not allowed to connect to this MySQL server"问题

情景:最近自己设计一些表,想利用自动生成工具来快速生成文件。由于数据库是本地的,生成工具的项目也是本地的,按照配置好数据源之后
启动项目,结果报错了,无法访问到数据库。
解决办法是:
  1. 我这里用的是Navicat Premium12版本,打开并且连接上;
  2. 看到里面有个mysql数据库,库里有张user表;
  3. 修改user表中的字段“Host”为“%”;
  4. 刷新数据库的权限,或者使用命令语句“flush privileges”。
    如图所示:
    message from server: "Host 'DESKTOP-QIR7OV5' is not allowed to connect to this MySQL server"问题

message from server: "Host 'DESKTOP-QIR7OV5' is not allowed to connect to this MySQL server"问题
这里刷新分好几种,我们只刷新权限就好了。