intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题
intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题

点击后发现Data Source为空,这时我们需要添加数据库

intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题

在idea最右边点击DataBase,在点加号

intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题
intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题

在连接数据库时又遇到了IDEA的database插件无法链接mysql(08001错误)

intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题

原因

造成这个问题的原因是因为数据库驱动包的版本问题,与当前的数据库版本不兼容(我的是mysql5.7版本,而驱动是8.0的版本)
  还有一些其他的情况,如提示timeZone不正确(或者是一串乱码)等大部分都是驱动的问题

解决办法

既然知道了问题的原因,那解决办法也就简单了,根据自己的mysql版本下载相应的驱动包:

我的是 mysql 5.7 版本,所以我要下载mysql 5.x的驱动 ,具体的操作见下图:

我们再IDEA中创建与数据库的链接的时候,可以选择驱动的版本:
   intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题intellij idea Entity类报错“Cannot resolve table”出现小红条 以及 Could not create connection to database问题

相关文章:

  • 2022-12-23
  • 2021-09-08
  • 2021-11-15
  • 2021-07-20
  • 2021-09-12
  • 2021-10-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-08-12
  • 2021-04-09
  • 2021-08-17
  • 2022-12-23
相关资源
相似解决方案