spring boot配置mysql

2024-10-30 00:01:09

1、创建spring boot项目,如下图所示

spring boot配置mysql

3、修改application.properties配置文件,添加如下代码spring.datasource.url=jdbc:mysql://localhost:3306/testspring.datasource.username=rootspring.datasource.password=rootspring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring boot配置mysql

5、点击启动按钮,启动程序

spring boot配置mysql
猜你喜欢