Improve error reporting when libmysqlclient or libpq are missing

fixes #7882