---
title: "错误信息概述 - OceanBase 数据库 V4.2.2 | OceanBase 文档中心"
description: 错误信息概述 本手册主要为您介绍 OceanBase 数据库中 MySQL 租户的错误信息。 错误信息格式 OceanBase 数据库高度兼容 MySQL，这不仅体现在常用 MySQL 功能及 MySQL 前后台协议，OceanBase 数据库原生的错误信息也对 MySQL 进行了兼容。因此，OceanBase 数据…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.2.2

# 错误信息概述

更新时间：2026-04-10 11:58:37

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.2.2/zh-CN/700.reference/900.error-code/600.error-code-of-mysql-mode/100.use-error-information-of-mysql-mode.md)  

本手册主要为您介绍 OceanBase 数据库中 MySQL 租户的错误信息。

## 错误信息格式

OceanBase 数据库高度兼容 MySQL，这不仅体现在常用 MySQL 功能及 MySQL 前后台协议，OceanBase 数据库原生的错误信息也对 MySQL 进行了兼容。因此，OceanBase 数据库 MySQL 租户的错误信息格式与 MySQL 保持一致。

错误信息格式如下所示：

```unknow
ERROR <err_num> (<sql_stat>) : err_msg

```

参数说明：

- `err_num` 表示错误码。
 - `sql_stat` 表示 SQL STATE。
 - `err_msg` 表示错误信息。

## 错误信息中的变量

为了帮助您找到并解决错误，OceanBase 数据库将参数嵌入了错误信息。本手册中，这些参数会以百分号（%）的形式展示。

示例如下：

```unknow
ERROR 4626 (HY000) : resource pool '%s' has already been granted to a tenant

```

上面的消息实际上可能显示如下：

```unknow
ERROR 4626 (HY000) : resource pool 'pool1' has already been granted to a tenant

```

## 错误信息一览表

系统错误码取值范围及其说明如下表所示。

| 错误码范围 | 说明 |
| --- | --- |
| [0001 ~ 3999](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508252) | 兼容 MySQL 的错误信息。 - 有关 MySQL 服务端错误码请参见     [https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html](https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html) - 有关 MySQL 客户端错误码请参见     [https://dev.mysql.com/doc/mysql-errors/8.0/en/client-error-reference.html](https://dev.mysql.com/doc/mysql-errors/8.0/en/client-error-reference.html) |
| [4000 ~ 4499](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508247) | 通用错误码。 |
| [4500 ~ 4999](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508249) | Root Service 错误码。 |
| [5000 ~ 5999](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508254) | SQL、WITH 子句及 Factoring 错误码。 |
| [6000 ~ 6999](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508253) | 事务、MVCC 与 clog 错误码。 |
| [7000 ~ 7999](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508255) | 选举模块错误码。 |
| [8000 ~ 8999](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508250) | 致命错误。 当客户端收到该范围内的错误时，需要关闭 SQL 连接。 |
| [9000 ~ 9499](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508251) | 备份恢复及 STORAGE 3.0 错误码。 |
| [9500 ~ 9999](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508256) | 过程语言 （PL）错误码。 |
| [22998、30926、38104、38105](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508248) | BLOB/CLOB 错误码。 |

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
