[title]springboot整合Mysql基础配置[/title]
yml配置:
spring:
datasource:
url: jdbc://mysql:localhost:3306/mp?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username: root
password: 123456
rewriteBatchedStatements设置为 true 可以加快 sql 速度,原理是mysql默认执行机制是以一条一条语句执行sql,开启rewriteBatchedStatements后会把sql语句拼成一条后执行。- THE END -
最后修改:2024年5月5日
一个记录开发笔记的社区
如若转载,请注明出处:/posts/springboot-%e6%95%b4%e5%90%88-mysql


评论区暂未迁移
旧站评论表还没有完全接入新版接口层,这里会继续按数据库方式补齐。