Port 9003 is not open by default in the test environment. Changing it to port 4006, which is open, will work around this restriction. Also added the mysql_error output to the error message when the querying fails.