配置MySQL数据库过程中经常出现的问题,在这里给大家说一下

idea配置MySQL数据库页面
常见问题一:数据库驱动driver-class-name设置错误
MySQL数据库之前用的比较多的时MySQL5.6/5.7版本,再后来就是现在用的比较多的MySQL8.0.*的版本两个版本的驱动是不同的,之前版本驱动com.mysql.jdbc.Driver,而我们目前的MySQL驱动应该使用com.mysql.cj.jdbc.Driver,点击MySQL,选择Go to Driver

然后选择对应的驱动

常见问题二:时区错误
这个错误直接在url后面添加?serverTimezone=GMT或者?serverTimezone=UTC就可以解决
常见问题三:idae连接数据库测试成功,显示的数据库表错误

数据库显示内容
遇到这种问题,需要我们录入数据库连接信息,测试成功后,需要勾选数据库才能显示

勾选自己的数据库,然后保存就可以正常显示出数据库中的表了
