配置mybatis-generator时遇到错误Communications link failure

错误报告:
“C:\Program Files\Java\jdk1.8.0_181\bin\java.exe” -Dmaven.multiModuleProjectDirectory=F:\IDEA -Dmaven.home=G:\apache-maven-3.6.2 -Dclassworlds.conf=G:\apache-maven-3.6.2\bin\m2.conf “-Dmaven.ext.class.path=G:\IDEA\IntelliJ IDEA 2019.3\plugins\maven\lib\maven-event-listener.jar” “-javaagent:G:\IDEA\IntelliJ IDEA 2019.3\lib\idea_rt.jar=54586:G:\IDEA\IntelliJ IDEA 2019.3\bin” -Dfile.encoding=UTF-8 -classpath G:\apache-maven-3.6.2\boot\plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version2019.3 org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate
[INFO] Scanning for projects…
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com:mmall:war:1.0-SNAPSHOT
[WARNING] ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 264, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] -----------------------------< com:mmall >------------------------------
[INFO] Building mmall Maven Webapp 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] — mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ mmall —
[INFO] Connecting to the Database
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.274 s
[INFO] Finished at: 2019-12-13T14:44:16+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project mmall: Communications link failure
[ERROR]
[ERROR] Last packet sent to the server was 0 ms ago.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

在网上一查,这个错误说明数据库连接失败,我依次查看了数据库连接情况、用户名和密码的正确性、用户的权限检查、JDBC的url,几乎把能改了都该了,还是报错。

datasource.properties
在这里插入图片描述突然我看到localhost和mysql端口号3306之间居然是点。。。emmm。。。按理说应该是冒号呀,我就改了一下。结果。。。
在这里插入图片描述
在这里插入图片描述
OK,fine。是我太蠢,这样的小错误困扰了我半天,改完之后不但root用户成功连接,我自定义的用户xiaozhan也能连接了。

全网都没有人犯这个错误吧!!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值