External SSL MySQL connection

I need to connect to an external MySQL connection with SSL but I can’t seem to make it work. I couldn’t find any topic regarding the matter or I may have missed it. Help to make this working would make my sad life easier.

Here’s what I did:



Not sure but it could be related to following:

You said external MySQL connection,

but in your DB config you have:

"dsn" => mysql:host=localhost;


Sorry for using localhost in this example, it’s for the sake of showing the attributes value. Now suppose “localhost” is actually an external ip, what would you do to connect it through SSL?. Thanks for responding.


Sorry, can’t help further since I have not done external MySQL connection over SSL so far.

I found this.

It is for Yii 1 but maybe it can help?




Thanks for the efforts. Seems I made a stupid path error and messed it up. It’s working properly now. Works on both external and internal MySQL connections.

I posted it here:


Happy Developing!!!