spring boot 连接到本地主机数据库

ran*_*ser 5 java mysql eclipse spring-boot

是否可以使用 eclipse 中的 spring boot 应用程序从 mamp 服务器(localhost)连接数据库并显示其中的数据?或者它是如何工作的,因为我不知道如何实现它?

 spring.datasource.url=jdbc:mysql://localhost/dbtuts
 spring.datasource.username=root
 spring.datasource.password=root
 spring.datasource.driver-class-name=com.mysql.jdbc.Driver
 spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
Run Code Online (Sandbox Code Playgroud)

这就是我一直用于 application.properties 的内容

Abh*_*wad 4

以下设置似乎对我来说效果很好。

spring.datasource.url=jdbc:mysql://localhost:8889/test
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
Run Code Online (Sandbox Code Playgroud)