How to get access to mysql database - cloudfoundry/cloud_controller_ng GitHub Wiki
bosh sshonto thedatabaseinstancesudo su -bosh manifestand locate theccdbpassword. If the environment is using CredHub (such as one of our bosh-lites) you can either:- look up this password in CredHub: https://github.com/cloudfoundry/capi-workspace/blob/master/scripts/mysql_bosh_lite [1] (this script has an example)
- Depending on the database find it in
/var/vcap/jobs/mysql/config/mariadb_ctl_config.yml/var/vcap/jobs/pxc-mysql/config/galera-init-config.yml
-
/var/vcap/packages/mariadb/bin/mysql -ucloud_controller -p"PASSWORD" -P 3306 -h sql-db.service.cf.internal cloud_controller/var/vcap/packages/pxc/bin/mysql -ucloud_controller -p"" -P 3306 -h sql-db.service.cf.internal cloud_controller
Bonus instructions for Postgres:
/var/vcap/packages/postgres-9.6.10/bin/psql -p 5524 -U cloud_controller