运行时报com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf8mb4'导致
浏览器报Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio+
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
真的只要换驱动就行
用的mysql6.0.5数据库,折磨两天的问题终于解决了,最后用5.1.6的驱动包解决
装别的版本 也能解决
上面的Mysql6.0被我砍了 数据库现在用 Mysql 5.7 或 8.0
项目的配置及maven依赖
jdbc.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://192.168.1.1:3306/testingdevice?useAffectedRows=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
jdbc.username=mysql8
jdbc.password=root
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://192.168.1.1:3306/testingdevice?useAffectedRows=true&useSSL=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT
jdbc.username=mysql5.7
jdbc.password=root
# 想升级为mysql8, 5.1.46替换为8.0.11
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version>
</dependency>
<!-- mybatis-generator自动生成代码插件 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<!--<scope>runtime</scope>-->
<version>5.1.46</version>
</dependency>
</dependencies>
</plugin>
浏览器报The origin server did not find a current representation for the target resource o
可能是你连接有问题
http://localhost:8080/ssm_pro/help/访问不了
http://localhost:8080/help/却可以,少了
在Controller层 类前加上
@RequestMapping("/ssm_pro") 则该类所有链接前都要加上 ssm_pro才能访问