spring boot useServerPrepStmts=true可能引起的异常

来源:互联网 发布:qq三国辅助软件 编辑:程序博客网 时间:2024/06/08 20:06

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的配置文件最后加

max_allowed_packet = 20M

原创粉丝点击