IntelliJ 和 Jpa Buddy - SSH 隧道数据库连接

发布于 01-17 03:25 字数 222 浏览 0 评论 0原文

我正在使用 IntelliJ Community Edition 和 JPA Buddy 开发一个 Java 项目(基于 Spring Boot 2.6.x)。我想使用 JPA Buddy 进行实体实用程序和 Liquibase 集成。

生产数据库(MySQL 5.7)只能通过 ssh 隧道访问。

有没有办法使用 ssh 隧道配置数据库连接?如何从生产数据库生成变更日志?

谢谢! 米奇

I'm working on a Java project (based on Spring Boot 2.6.x) using IntelliJ Community Edition and JPA Buddy. I want to use JPA Buddy for entity utility and Liquibase integration.

The production DB (MySQL 5.7) is reachable only by ssh tunnel.

Is there a way to configure a DB connection using ssh tunnel? How can I generate a changeLog from the production DB?

Thanks!
Miky

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好多鱼好多余2025-01-24 03:25:21

当您谈到 PROD 数据库时 - 当然,更好的选择是制作备份/恢复本地副本并使用它。但是关于问题的第一部分,您可以使用 ssh 端口转发 例如:

ssh   -R 13306:0.0.0.0:3306 user@server -N
# 13306 your machine local port
# 3306 server remote port

并从 IntelliJ 连接到远程 MySQL 服务器到 localhost:13306

As you speak about the PROD database - of course, a better option is to make backup/restore local copy and play with it. But regarding the first part of your question you can use ssh port forwarding e.g.:

ssh   -R 13306:0.0.0.0:3306 user@server -N
# 13306 your machine local port
# 3306 server remote port

and connect to remote MySQL server from your IntelliJ to localhost:13306

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文