diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java index 4000ea8bbce477d..0cfb96130706503 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java +++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java @@ -242,11 +242,13 @@ public static boolean negotiate(ConnectContext context) throws IOException { if (catalogName != null) { CatalogIf catalogIf = context.getEnv().getCatalogMgr().getCatalog(catalogName); if (catalogIf == null) { - context.getState().setError(ErrorCode.ERR_BAD_DB_ERROR, "No match catalog in doris: " + db); + context.getState() + .setError(ErrorCode.ERR_BAD_DB_ERROR, ErrorCode.ERR_BAD_DB_ERROR.formatErrorMsg(db)); return false; } if (catalogIf.getDbNullable(dbFullName) == null) { - context.getState().setError(ErrorCode.ERR_BAD_DB_ERROR, "No match database in doris: " + db); + context.getState() + .setError(ErrorCode.ERR_BAD_DB_ERROR, ErrorCode.ERR_BAD_DB_ERROR.formatErrorMsg(db)); return false; } }