I have the following error message:
SQLSTATE[HY000] [2003] Can't connect to MySQL server on '192.168.50.45' (4)
How would I parse this (I have HY000, I have 2003 and I have the (4).
HY000 is a very general ODBC-level error code, and 2003 is the MySQL-specific error code that means that the initial server connection failed. 4 is the error code from the failed OS-level call that the MySQL driver tried to make. (For example, on Linux you will see "(111)" when the connection was refused, because the connect()
call failed with the ECONNREFUSED error code, which has a value of 111.)