diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 2f1aaea37d08c8bd76824a4780060d1bd061a098..4992d2514c9b5e90e8e74c89354e1662d7382c79 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1168,7 +1168,14 @@ pthread_handler_t handle_one_connection(void *arg)
     {
       execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect);
       if (thd->query_error)
+      {
 	thd->killed= THD::KILL_CONNECTION;
+        sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
+                          thd->thread_id,(thd->db ? thd->db : "unconnected"),
+                          sctx->user ? sctx->user : "unauthenticated",
+                          sctx->host_or_ip, "init_connect command failed");
+        sql_print_warning("%s", net->last_error);
+      }
       thd->proc_info=0;
       thd->set_time();
       thd->init_for_queries();