First off let me say that I solved my problem of sqlstate[hy000] [2002] connection refused
by following this stackoverflow question: Laravel: SQLSTATE[HY000] [2002] Connection refused
However I'm confused as to why localhost works and 127.0.0.1 doesn't. Can someone explain the differences? I thought they were the same thing so long as your 127.0.0.1 was mapped to localhost in your /etc/hosts file.
Not really too sure if this questions needs more information then that, if you do, i'll be glad to provide it.
Edit: Sorry if this is a poorly worded question, I put the question as simply as possible. Considering that the 'problem' of this question no longer exists, I'm really just looking for more of an explanation as to why the answer in the above Stackoverflow Question worked. Not much information was given in that answer. Poorly given answer if I do say so myself.
Edit 2: My system setup consists of Virtualbox, Vargant, and Laravel Homestead. I have a vagrant box set up with the mysql port at 33060 (Standard port upon setup). I'm able to connect via SQLPro to 127.0.0.1:33060 just fine. However through my Laravel app I'm not able to connect via 127.0.0.1 only localhost. Is this still an issue with my configuration of mysql if i'm able to connect using both localhost in the app, and 127.0.0.1 in SQLPro? Doesn't this mean that I should be able to connect to either or and vise versa?