I have the following error message:
SQLSTATE[HY000] [2003] Can\'t connect to MySQL server on \'192.168.50.45\' (4)
How would I
I was just struggling with the same issue.
Disable the DNS hostname lookups solved the issue for me.
[mysqld] ... ... skip-name-resolve
Don't forget to restart MySQL to take effect.