The article provides the steps to identify and connect to the dataflow or skipper databases for a Spring Cloud Dataflow instance for Cloud Foundry.
Tanzu Application Services
Spring Cloud Dataflow for Tanzu
Steps to connect to the backend databases in Cloud Foundry.
cf target -o <ORG> -s <SPACE>
Sample:
$ cf target -o test -s test
API endpoint: https://api.example.com
API version: 3.166.0
user: myuser
org: test
space: test
cf service <SCDF-INSTANCE> ---guid
Sample:
$ cf service mydf --guid
abcd****xyz
cf target -o p-dataflow -s <SERVICE_INSTANCE_GUID>
Sample - Using the GUID from step #3
$ cf target -o p-dataflow -s abcd****xyz
API endpoint: https://api.example.com
API version: 3.166.0
user: myuser
org: p-dataflow
space: abcd****xyz
Sample: List the services
$ cf services
Getting services in org p-dataflow / space abcd****xyz as myuser...
name service plan bound apps last operation broker upgrade available
df-messaging p-rabbitmq standard create succeeded p-rabbitmq
df-relational p.mysql db-small dataflow create succeeded dedicated-mysql-broker no
skipper-relational p.mysql db-small skipper create succeeded dedicated-mysql-broker no
cf service <SERVICE_INSTANCE> --guid
Sample:
For Skipper db - "skipper-relational"
$ cf service skipper-relational --guid
1234*****1234
Note: For Dataflow db use "df-relational"
bosh -d service-instance_<MYSQL_SERVICE_GUID>
Sample:
$ bosh -d service-instance_1234*****1234 ssh mysql/0
mysql/567***567:~$
sudo -i
find / -name mylogin.cnf
Sample:
$ find / -name mylogin.cnf
/var/vcap/data/jobs/mysql/76543**76543/config/mylogin.cnf
mysql --defaults-file=<PATH_OF_MYLOGIN_CNF_FILE>
Sample:
$ mysql --defaults-file=/var/vcap/data/jobs/mysql/76543**76543/config/mylogin.cnf
mysql > use service_instance_db
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed