1. mysql配置错误描述
Caused by: java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the main URL sections.
2.分析原因
由于自己的粗心大意,将配置文件写成了如下:
url=127.0.0.1:3306/mybatis?useUnicode=true&serverTimezone=GMT&characterEncoding=utf8&useSSL=true
故而导致以上错误的出现。
提示:在配置文件的时候一定要小心,仔细检查,能copy的千万不要自己动手敲代码,错误率会很高,同时注意把握好细节;
3.解决方法
将jdbc的URL配置改为
url=jdbc:mysql://127.0.0.1:3306/mybatis?useUnicode=true&serverTimezone=GMT&characterEncoding=utf8&useSSL=true
程序即可正常