Can anyone help with a config.php example to connect a Yii2 app running on one host to a remote host MySQL server through SSH. I have only ever run MySQL on the same localhost as the app itself, with a db.php config something like this:
<?php
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;port=3306;dbname=mylocaldb',
'username' => 'auser',
'password' => 'apassword',
'charset' => 'utf8',
];
How do I specify the SSH tunnel, i.e., its host name and RSA key file? Don't see anything in the yii\db\Connection API that gives me a clue. Is this even possible?
Thanks in advance.
Joe