如何为PCF mySQL数据库设置MySQL开发工具进行管理 [英] How to setup mysql develper for PCF mySQL database to manage it

查看:110
本文介绍了如何为PCF mySQL数据库设置MySQL开发工具进行管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图理解PCF的概念,并认为一旦完成了在PCF中创建mysql服务的工作,我将如何像创建表​​和维护该表一样管理该数据库,就像我们在纯传统环境中使用mySqldeveoper所做的那样。我遇到了像PivotalMySQLWeb这样的一项服务,尝试过但并不喜欢它。因此,如果我能以某种方式获得mysql服务的连接详细信息,则可以使用sql Developer进行连接。

I am trying to understand PCF concepts and thinking that once i am done with creating mysql services in PCF, how i can manage that database like creating tables and maintaining that table just like we do in pur traditional environment using mySqldeveoper. I came across one service like PivotalMySQLWeb and tried but didnt liked it much. So if somehow i can get connection details of mysql service , i can use that to connect using sql developer.

推荐答案

链接@

http://docs.pivotal.io/p-mysql/2-0/use.html
https://github.com/andreasf/cf-mysql-plugin#usage

更一般而言,您可以使用SSH隧道访问任何服务,而不仅仅是MySQL。这也使您可以使用想要访问该服务的任何工具。

More generally, you can use an SSH tunnel to access any service, not just MySQL. This also allows you to use whatever tool you would like to access the service.

此文档记录在此处,但是如果由于某些原因而消失,则可以执行以下步骤。

This is documented here, but if for some reason that goes away here are the steps.


  1. 创建目标服务实例(如果还没有的话)。

  2. 推送应用程序,任何应用程序。没关系,它可以是hello world应用程序。该应用甚至不需要使用该服务。我们只需要连接一些东西即可。

  3. 或者将服务从#1绑定到#2中的应用程序,或者使用#1中的服务创建服务密钥。如果您绑定到应用程序,请运行 cf env< app> ,或者如果您使用服务密钥,请运行 cf service-key MY-DB EXTERNAL- ACCESS-KEY ,任何一个都将为您提供服务凭据。

  4. 运行 cf ssh -L 63306:us-cdbr-iron- east-01.p-mysql.net:3306 YOUR-HOST-APP ,其中 63306 是您要连接到的本地端口机器和 us-cdbr-iron-east-01.p-mysql.net:3306 是步骤3中凭据的主机和端口。

  5. 隧道现已建立,使用您想连接到服务的任何客户端。例如: mysql -u b5136e448be920 -h localhost -p -D ad_b2fca6t49704585d -P 63306 ,其中 b5136e448be920 ad_b2fca6t49704585d 是步骤3中的用户名和数据库名称,63306是您从步骤4中选择的本地端口。

  1. Create your target service instance, if you don't have one already.
  2. Push an app, any app. It really doesn't matter, it can be a hello world app. The app doesn't even need to use the service. We just need something to connect to.
  3. Either Bind the service from #1 to the app in #2 or create a service key using the service from #1. If you bind to the app, run cf env <app> or if you use a service key run cf service-key MY-DB EXTERNAL-ACCESS-KEY and either one will give you your service credentials.
  4. Run cf ssh -L 63306:us-cdbr-iron-east-01.p-mysql.net:3306 YOUR-HOST-APP, where 63306 is the local port you'll connect to on your machine and us-cdbr-iron-east-01.p-mysql.net:3306 are the host and port from the credentials in step #3.
  5. The tunnel is now up, use whatever client you'd like to connect to your service. For example: mysql -u b5136e448be920 -h localhost -p -D ad_b2fca6t49704585d -P 63306, where b5136e448be920 and ad_b2fca6t49704585d are the username and database name from step #3 and 63306 is the local port you picked from step #4.

这篇关于如何为PCF mySQL数据库设置MySQL开发工具进行管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆