How to connect to Tanzu Kubernetes Grid Integrated Edition MySQL database
search cancel

How to connect to Tanzu Kubernetes Grid Integrated Edition MySQL database

book

Article ID: 298698

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

This article covers how do I connect to the Tanzu Kubernetes Grid Integrated Edition (TKGI) MySQL Database.

Environment

Product Version: 1.11

Resolution

Warning: Even though you have access to various databases, it is NOT suggested to alter any of these databases directly. If you have any doubt about the following steps, please contact VMware Tanzu Support and perform the following steps under their guidance.

With a fully deployed Tanzu Kubernetes Grid Integrated Edition (TKGI) environment, there are many VMs and databases associated with the environment and sometimes it is necessary to access to those VMs and databases for troubleshooting purposes.

Note: This article assumes you have enough knowledge of these associated databases, which is why we are not trying to explain the role of each database.
 

Prerequisites

  • You have fully deployed TKGI environment.
  • You have access to Ops Manager.

Procedure

1. Follow the instructions here to login into ops manager and configure the bosh cli.

2. Use the following command to list bosh deployments:

$ bosh -e <env> deps --column name


3. Use the following command to ssh into the pks-db VM: 

$ bosh -d pivotal-container-service-<guid> ssh pks-db/<guid>


4. Where pivotal-container-service-<guid> is from the output from deps output.

5. Run this command: 

$ sudo -i


6. Run this command:

# find /var/vcap/data/jobs -type f | grep mylogin.cnf


7. Connect to MySQL:

Method 1: Using the output from the find, run command: 

# mysql --defaults-file=/var/vcap/data/jobs/pxc-mysql/<guid>/config/mylogin.cnf


Method 2: Run this command:

 /usr/local/bin/mysql -u root -p uaa -S /var/vcap/data/sys/run/pxc-mysql/mysqld.sock


For more information, refer to this the article How to Access VMs and Databases related to VMware Tanzu Kubernetes Grid Integrated Edition.