I am using Laravel to connect to MySQL database.
I got this exception:
PDOException SQLSTATE[HY000] [1049] Unknown database \'forge\'
In my particular case, I finally realised that my phpMyAdmin was using port 3308 while Laravel was attempting to connect through 3306. so my advice would be to ensure you have the correct connection string!