I have a couple of connections to each of them going to a different MySQL database, the issue is that one connects to a local server itself, but the other goes to a remote server and under "another port", I manage connections like this:
$capsule->addConnection([
'driver' => 'mysql',
'host' => LOCAL_DB_HST,
'database' => LOCAL_DB_NAM,
'username' => LOCAL_DB_USR,
'password' => LOCAL_DB_PWD,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => ''
], "local");
$capsule->addConnection([
'driver' => 'mysql',
'host' => REMOTE_DB_HST,
'database' => REMOTE_DB_NAM,
'username' => REMOTE_DB_USR,
'password' => REMOTE_DB_PWD,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => ''
], "remota");
It's important to clarify that I'm not using Eloquent as part of Laravel... but as a totally stand-alone implementation.
The issue is that the remote MySQL server uses a port other than 3306 and I don't know how to tell Eloquent to use another port when connecting to the remote server as long as it keeps the default port (3306) for the local connection.
I've never used it without laravel, but I reckon it has to work the same and if so you can specify the port for it. It would be something like this:
Within Laravel the configuration of a mysql database is like this, maybe it will help you.