Two ways to do it. You can pick what suits you better. Both have their advantages.
1. You can declare $Cluster as another Input Parameter to your command. Something like below
[Parameter(Mandatory = $true, HelpMessage="Cluster")]
Now in your workflow, you for this parameter declare variable as $Cluster_name and go to Setup > User-Inputs tab. Double-click to edit this variable input from string to type: Query. Now write your query and you get the Cluster.
2. You can make use of the mysql .NET connector and the attached powershell module to run queries directly from your command.
You can use the below code snippet in your command to run mySQL queries directly from your command.
### begin snip ###
$ConnectionString = "server=localhost;port=3306;uid=wfa;pwd=Wfa123"
$Query = "select * from playground.bu"
$Connection = New-Object MySql.Data.MySqlClient.MySqlConnection
$Connection.ConnectionString = $ConnectionString
$Command = New-Object MySql.Data.MySqlClient.MySqlCommand($Query, $Connection)
$DataAdapter = New-Object MySql.Data.MySqlClient.MySqlDataAdapter($Command)
$DataSet = New-Object System.Data.DataSet
# list of row objects
$query_result = $DataSet.Tables
Write-Host "ERROR : Unable to run query : $query `n$Error"
## end snippet.
The 2nd option has some big advantages over the 1st one.
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.