spring boot useServerPrepStmts=true可能引起的异常
2017-08-15 20:56
459 查看
MyBatis 配置一下参数有可能会引起mysql抛出异常:
When 'us
eServerPrepStmts=true', 'maxAllowedPacket' must be higher than 8203. Check also
'max_allowed_packet' in MySQL configuration files.
datasource.addDataSourceProperty("cachePrepStmts", "true");
datasource.addDataSourceProperty("prepStmtCacheSize", "250");
datasource.addDataSourceProperty("prepStmtCacheSqlLimit", "1024");
datasource.addDataSourceProperty("useServerPrepStmts", "true");
解决方式是在mysql的配置文件最后加
When 'us
eServerPrepStmts=true', 'maxAllowedPacket' must be higher than 8203. Check also
'max_allowed_packet' in MySQL configuration files.
datasource.addDataSourceProperty("cachePrepStmts", "true");
datasource.addDataSourceProperty("prepStmtCacheSize", "250");
datasource.addDataSourceProperty("prepStmtCacheSqlLimit", "1024");
datasource.addDataSourceProperty("useServerPrepStmts", "true");
解决方式是在mysql的配置文件最后加
max_allowed_packet = 20M
相关文章推荐
- C# Winform/Server 提交协议冲突 Section=ResponseStatusLine 的解决,可能是服务器引起的异常
- [spring boot][异常处理] java.net.BindException: Address already in use: bind
- spring boot使用jpa的@Modify的clearAutomatically=true的作用
- 企业分布式微服务云SpringCloud SpringBoot mybatis (五)Spring Boot中Web应用的统一异常处理
- SpringBoot学习历程(4)->全局异常的处理
- (5)全局异常捕捉【从零开始学Spring Boot】
- Java SpringBoot中使用sqljdbc4注意事项 java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
- Spring Cloud Spring Boot mybatis分布式微服务云架构(十一)Web应用的统一异常处理
- 第四十五章 SpringBoot全局异常处理
- Mac OS X:Analysis of the Use of the Boot Server Discovery Protocol in NetBoot
- SpringBoot 1.1.9.RELEASE升级1.3.6.RELEASE所遇异常
- SpringBoot实战 之 异常处理篇
- STS创建Spring Boot项目实战(Rest接口、数据库、用户认证、分布式Token JWT、Redis操作、日志和统一异常处理)
- springboot+shiro+cas实现单点登录之cas server搭建
- 使用springboot框架写项目打包jar发布后读取项目下静态文件异常
- spring-boot中统一异常处理
- [解决]IntelliJ IDEA 中启动Tomcat服务器异常 java.rmi.server.ExportException: Port already in use: 1099
- springBoot的返回code数据的处理以及统一异常处理
- IDEA中SpringBoot项目启动遇到端口被占用(Address already in use: bind)