MySQL reports with ODBC error numbers which include a SQLSTATE. HY000 is a MySQL ODBC extension for there being no ODBC equivalent error number from the docs on Server Error Codes and Messages
A five-character SQLSTATE value ('42S02'). The values are taken from ANSI SQL and ODBC and are more standardized. Not all MySQL error numbers have corresponding SQLSTATE values. In these cases, 'HY000' (general error) is used.
You can find the HY000 Error Codes in error_code.h, and the full list of authoritative ODBC error codes from the Microsoft ODBC Appendix
The 2 "No such file or directory" is operating system specific.