连接Mysql数据库时遇到问题:
在IntelliJ IDEA上整合Mybatis和Spring的,运行测试用例出现了如上错误。红色的马赛克部分是我的名字。
问题一:
数据库里面没有以我名字为用户名的用户。而只有IntelliJIDEA是用我的名字授权的,难道和这个有关?最后我在mysql中创建了一个我名字的用户。然后把数据库配置文件中的用户名和密码改成我的用户名密码,居然可以了。现在是可以使用整合的框架测试了。
问题二:
当我新建一个test用户后,把数据库配置文件改成test用户的信息,还是报上图的错。所以是不能改其他用户了?试过用管理员身份(电脑是win10系统,考虑可能权限要求高)打开IntelliJIDEA,然并卵,还是只能登我的账户密码。。。
解决方案:
原配置数据库连接信息:
改成这样就可以了:
新发现,改成这样也可以:
只要不写成username好像都可以,username这个变量好像被jvm环境占用了(继续探讨)
问题三:
Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.解决方案:
设置useSSL=false jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false版权声明:本文为博主原创文章,未经博主允许不得转载。
https://blog.youkuaiyun.com/minkeyto/article/details/82526518