mysql 错 Could not open JDBC Connection for transaction; nested exception is java.sql.SQLExceptio

 

运行时报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才能访问
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

huang_ftpjh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值