Springboot连接MySql数据库的脚本配置模板
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/spring_db?useUnicode=true&characterEncoding=utf-8
username: root
password: 123456
简单说明一下:
以上内容需要配置在application.yml(或者yaml)文件中
里面需要声明的还是那4个配置信息
driver、url、username、password
其格式是不变的,可变的是:
1.数据库的url中的IP地址和数据库;
2.数据库的账号密码;