Error message:
Solution:
1. First add: &allowMultiQueries=true
after the database connection string
jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
2. If there is still error, add a file
@Configuration
public class DruidConfig {
@Bean
@ConfigurationProperties(prefix="spring.datasource")
public DataSource druidPrimary(){
DruidDataSource druidDataSource = new DruidDataSource();
List<Filter> filterList = new ArrayList<>();
filterList.add(wallFilter());
druidDataSource.setProxyFilters(filterList);
return new DruidDataSource();
}
@Bean
public WallFilter wallFilter(){
WallFilter wallFilter = new WallFilter();
wallFilter.setConfig(wallConfig());
return wallFilter;
}
@Bean
public WallConfig wallConfig() {
WallConfig config = new WallConfig();
config.setMultiStatementAllow(true);//允许一次执行多条语句
config.setNoneBaseStatementAllow(true);//允许一次执行多条语句
return config;
}
}
Read More:
- Mybatis Error: Invalid bound statement (not found)
- [Solved] Mybatis-Plus Error: Invalid bound statement (not found)
- How to Solve Mybatis error: invalid bound statement (not found)
- Springboot mybatis Integrate Error: Invalid bound statement (not found): com…DepartmentMapper.save
- Mybatis plus configuration console prints complete SQL statement with parameters
- [Solved] Mybatis Error: Could not find resource mybatis-conf.xml
- Using mybatis statement.getGenreatedKeys(); usegeneratedkeys = “true”; using self incrementing primary key to get primary key value policy and Oracle do not support self incrementing, Oracle uses sequence
- [Solved] Mybatis.generator error: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2
- Ternary operator in Java?: error: not a statement
- [Solved] Tk-Mybatis Error: tk.mybatis.mapper.MapperException:
- [Solved] ClickHouse Error: Code: 62. DB::Exception: Syntax error (Multi-statements are not allowed): fai
- [How to Solve] Invalid bound statement (not found)
- [Solved] mybatis plus Insert Error: mybatis plus Error setting null for parameter #1 with JdbcType OTHER
- How to Solve Error: Invalid bound statement (not found)
- HQL statement query error: could not resolve property [Solved]
- C++: Implementation of multi-channel IO transfer with select
- There was an unexpected error (type=Internal Server Error, status=500).Invalid bound statement (not
- [Solved] Maven Multi-Project Compile Error: The POM for xxx is invalid
- Mybatis sets the primary key Auto-Increment error: No setter found for the keyProperty
- Mybatis-plus: How to Execute Native SQL