I\'ve been searching all over the internet and haven\'t had any success.
eg: https://laravel.io/forum/06-18-2014-connecting-mysql-over-ssl?page=1 https://laracasts
Sometimes, the same error is displayed when you don't have permissions for access remotely to the database.
example here:
So, you can try from Server1-app:
$ mysql -u youruser -h yourpassword;
And into mysql terminal, check if you are able to access to the database:
$ show databases;
If your database is shown, you have privileges and everything is ok, if not, you must acces to your Server2-database and grant privileges to your user.
Once in Server2-database;
$ mysql -u root -p
$ GRANT ALL PRIVILEGES ON your_database.* TO 'youruser'@'123.123.123.12';
$ FLUSH PRIVILEGES;
$ exit;
Hope it be helpful;