【问题标题】:How to setup a MySQL Database Connection with Spring in IntelliJ?如何在 IntelliJ 中使用 Spring 设置 MySQL 数据库连接?
【发布时间】:2020-07-16 12:22:58
【问题描述】:

我想在 IntelliJ 中将 XAMPP 和 MySQL 用于本地数据库,但我没有计划如何做到这一点...

你知道一些设置教程吗?

或者有没有我不需要使用 PHP 的替代方案?

【问题讨论】:

  • 您可以安装 MySQL,然后从 IntelliJ 连接到数据库。你不需要 phpMyAdmin
  • 有什么区别? @SimonMartinelli
  • 你只需要数据库。没有 Apache,没有 PHP,没有 phpMyAdmin
  • 但我更喜欢带有服务的 WebServer
  • 你为什么想要一个网络服务器。您正在编写 Java 应用程序

标签: mysql spring spring-boot intellij-idea xampp


【解决方案1】:

您无需将 IDE 与数据库集成。只需将连接字符串和其他内容插入到 application.properties 文件中即可。

例如;

spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_example
spring.datasource.username=username
spring.datasource.password=password 

如果你想在 IDE 中管理你的数据库,你可以按照这个; https://www.jetbrains.com/help/idea/2016.2/managing-data-sources.html

【讨论】:

    猜你喜欢
    • 2019-02-26
    • 1970-01-01
    • 2016-09-15
    • 1970-01-01
    • 1970-01-01
    • 2017-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多