When I'm personally curious about what Environment Variables are available in a given plugin or data platform, I will add a Configure Clone bash shell command temporarily to simply echo the Environment Variables to a text file for review, then I can remove it and use the reference to modify my other script operations as needed.
If you can provide specifics on which version of MySQL plugin your question is concerning, we may be able to offer more a more detailed response, as the value may not be set or exported as any environment variable, but sourced through other operations and therefore not viable to use an Environment Variable. I see some details of the socket defined in one MySQL plugin version, but it would help to have specific details from your deployment so we speak to it accurately.
Here's a basic example from a generic vFiles provision.
$ cat /tmp/env.out
SSH_CONNECTION=10.43.55.213 49636 10.43.40.13 22
SSH_CLIENT=10.43.55.213 49636 22
Senior Principal Technical Support Engineer
Sent: 06-04-2022 06:39:58 AM
From: Hebert Vinicius
Subject: Is it possible to obtain, when provisioning mysql banks, the port and socket that are being provisioned?
In Oracle VDB provisioning, I can set an environment variable for the VDB that will be available in Hook operations of this vdb (Custom Enviromnent Variables).
Also, 'natural' oracle variables are set according to the vdb being provisioned. If I'm refreshing vdb VBANCO1, then ORACLE_SID will be VBANCO1 without me needing to set anything.
Where I want to go is:
When provisioning mysql databases, in Hook scripts, I need to know the socket path of this mysql vdb that is being manipulated to make a connection to the database and perform operations on the database.
This information is already contained in the mysql plugin operations, just know if the plugin exports these variables for use and, if so, what are their names? If not, is it possible to implement?
If they are set, it is by the plugin, as they are values that are known at the time of operation by Delphix. For this reason, they cannot be set in SO beforehand. If they have to be, this breaks the concept of agility, dynamism and automation of the solution, because I would have to keep putting this information in the machine's ENV (which I have no way of knowing about it without doing research on the OS processes) in hand, after provisioning the VDB.
Use case example: What I need to do is this.
Note that without knowing the exact name of these variables it is not possible to access this data about the configuration being assembled. However, the plugin has knowledge of all this information, as they are all used to assemble the database.
It is also not possible to set Custom Enviromnment Variables in custom plugins provisioning (since it is a vfile provisioning), just as it is possible to provision oracle vdbs.
So, my question is:
How to dynamically get or access, in Hook script, the port and socket of the mysql database being provisioned/refreshed by delphix?