The MySQL Workbench is opening a SSH tunnel and then connects to the MySQL database.
You cannot do that in PHP (LimeSurvey) by just changing the connection string of the database layer.
To mimic the behavior of the MySQL Workbench a simple approach would mean to open a ssh connection (different approaches to open a ssh tunnel, e.g. via php shell_exec or on OS level).
The whole topic is not LimeSurvey related. It's a database or server topic, which involves some decisions about security and performance.
You will find a lot of information when searching for keywords "Connect remote MySQL SSH tunnel"
Some pro/cons can be found here
stackoverflow.com/questions/464317/conne...rver-over-ssh-in-php