简体   繁体   English

如何在Openshift中使用Navicat连接到MySQL数据库

[英]How to use Navicat to connect to the MySQL database in Openshift

I'm using openshift to build my apps. 我正在使用openshift来构建我的应用程序。
And I add mysql to my gear. 然后将mysql添加到我的设备中。

but, if I want to reach my database. 但是,如果我想访问我的数据库。 I can't use Navicat which is my usual way to manage my database. 我不能使用Navicat,这是我管理数据库的常用方法。 I must ssh to my openshift server and then use command line 'mysql' to reach my database which is a bad way compared to Navicat. 我必须SSH到openshift服务器,然后使用命令行“ mysql”访问数据库,这与Navicat相比是一种不好的方法。

So, how can I reach my database in Openshift with Navicat? 那么,如何使用Navicat在Openshift中访问数据库?

I've used env | grep MYSQL 我用过env | grep MYSQL env | grep MYSQL to get my mysql configration and use it in Navicat. env | grep MYSQL获取我的mysql配置并在Navicat中使用它。
However, all is none effect. 但是,一切都不起作用。

If its a scalable application you should be able to connect to it externally via the connection information supplied by the environment variables. 如果它是可扩展的应用程序,则您应该能够通过环境变量提供的连接信息从外部连接到它。 If its not a scalable app, then you'll need to use the rhc port-forward command to forward the necessary ports needed to connect. 如果它不是可扩展的应用程序,则需要使用rhc port-forward命令来转发连接所需的必要端口。

Take a look at the following article here for more information. 在此处查看以下文章以了解更多信息。 https://www.openshift.com/blogs/getting-started-with-port-forwarding-on-openshift https://www.openshift.com/blogs/getting-started-with-port-forwarding-on-openshift

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM