Skip to content

How to get access to mysql database

Tim Downey edited this page Dec 11, 2018 · 9 revisions
  1. bosh ssh onto the database instance
  2. sudo su -
  3. bosh manifest and locate the ccdb password. If the environment is using CredHub (such as one of our bosh-lites) you can either:
    1. look up this password in CredHub: https://github.com/cloudfoundry/capi-workspace/blob/master/scripts/mysql_bosh_lite [1] (this script has an example)
    2. Depending on the database find it in
      1. /var/vcap/jobs/mysql/config/mariadb_ctl_config.yml
      2. /var/vcap/jobs/pxc-mysql/config/galera-init-config.yml
    1. /var/vcap/packages/mariadb/bin/mysql -ucloud_controller -p"PASSWORD" -P 3306 -h sql-db.service.cf.internal cloud_controller
    2. /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

[1] potentially outdated mysql_bosh_lite permalink

Clone this wiki locally