mysql数据库连接配置文件(db.properties)

db.driver = com.mysql.jdbc.Driver
db.url = jdbc:mysql://localhost:3306/learn-test?useUnicode=true&characterEncoding=utf8 
db.username = root
db.password = 123456

说明:如url使用的是本地数据库且端口是3306,可以省略 localhost:3306,即:

db.url = jdbc:mysql:///learn-test?useUnicode=true&characterEncoding=utf8 

properties文件全部是字符串,以key=value形式存在,=两边可以有空格,也可以没有空格

yml格式:

db:
  driver: com.mysql.jdbc.Driver
  url: jdbc:mysql://localhost:3306/learn-test?useUnicode=true&characterEncoding=utf8
  username: root
  password: 123456
发布了43 篇原创文章 · 获赞 13 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/qq_41070393/article/details/79374715
今日推荐