How to connect to the VMware Tanzu Application Service (TAS) for VMs internal MySQL database
search cancel

How to connect to the VMware Tanzu Application Service (TAS) for VMs internal MySQL database

book

Article ID: 297547

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

This article discusses how to connect to the TAS internal MySQL database. TAS uses this database to store information for UAADB, Apps Manager DB, CCDB, App Usage Events DB, Autoscaling, and Notifications. 


Environment


Resolution

Follow the steps below within the TAS Tile of Operations (Ops) Manager:

For TAS for VMs versions 1.11 and lower:

1. Depending on your configuration, you can connect directly to one of the many nodes in the cluster and not the proxy node. Select the Status tab and retrieve the IP from the specific MySQL Servernode

2. Select the Credentials tab and retrieve the Mysql Admin Credentials from MySQL Server

3. SSH into Ops Manager or a VM that has direct access to the MySQL DB Node and has the MySQL client installed.

4. Run the following command mysql -h <ip> -u root -p where the IP is retrieved from step 1 above. The password will be prompted after you select enter.


For versions 1.12 and higher:

1. Connect to one of the MySQL VM's by BOSH CLI. 
bosh -d <CF-DEPLOYMENT> ssh mysql/0
2. Type the following commands to start mysql with credentials sourced from mylogin.cnf.
mysql --defaults-file=/var/vcap/jobs/mysql/config/mylogin.cnf
  • If you have migrated TAS internal MySQL database to Percona. 
mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf

CAUTION: The TAS internal MySQL database stores critical data for several key TAS components. If you are not sure about the impact when attempting to alter data in TAS internal MySQL database, please contact VMware Support.

Additional Information

Here are a few popular MySQL commands:

  • To list database type the following command at MySQL prompt:
mysql> show databases; (this displays databases)
 
  • To use the database and to enlist the available tables type, here are two commands:

         mysql> use DATABASE;
         mysql> show tables;


Also, link to the bootstrap docs as they instruct you to run commands to check the status of the cluster.

https://docs.pivotal.io/platform/application-service/2-9/mysql/mysql-diag.html
https://docs.pivotal.io/platform/application-service/2-9/mysql/bootstrap-mysql.html