---
title: "在 Tableau 中连接 OceanBase 数据库 - OceanBase 数据库 V4.3.2 | OceanBase 文档中心"
description: 在 Tableau 中连接 OceanBase 数据库 本文以 OceanBase 数据库 MySQL 模式租户为例，介绍如何将 OceanBase 数据库中的数据导入 Tableau Desktop 进行展示。 前提条件 您已下载并安装 Tableau Desktop。 您已安装 OceanBase 数据库并且创建…
---
切换语言

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

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

# 在 Tableau 中连接 OceanBase 数据库

更新时间：2024-10-10 21:40:45

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.3.2/zh-CN/680.ecological-integration/700.visualization/500.tableau.md)  

本文以 OceanBase 数据库 MySQL 模式租户为例，介绍如何将 OceanBase 数据库中的数据导入 Tableau Desktop 进行展示。

## 前提条件

- 您已下载并安装 Tableau Desktop。
 - 您已安装 OceanBase 数据库并且创建了 MySQL 模式租户。

## 操作步骤

### 步骤一：获取数据库连接串

联系 OceanBase 数据库部署人员或者管理员获取相应的数据库连接串，例如：

```
obclient -h$host -P$port -u$user_name -p$password -D$database_name

```

**参数说明：**

- `$host`：提供 OceanBase 数据库连接 IP。OceanBase 数据库代理（OceanBase Database Proxy，ODP）连接方式使用的是一个 ODP 地址；直连方式使用的是 OBServer 节点的 IP 地址。
 - `$port`：提供 OceanBase 数据库连接端口。ODP 连接的方式默认是 `2883`，在部署 ODP 时可自定义；直连方式默认是 `2881`，在部署 OceanBase 数据库时可自定义。
 - `$database_name`：需要访问的数据库名称。

  #### 注意

  连接租户的用户需要拥有该数据库的 `CREATE`、`INSERT`、`DROP` 和 `SELECT` 权限。更多有关用户权限的信息，请参见 [MySQL 模式下的权限分类](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001052880)。
 - `$user_name`：提供租户的连接账户。ODP 连接的常用格式：`用户名@租户名#集群名` 或者 `集群名:租户名:用户名`；直连方式格式：`用户名@租户名`。
 - `$password`：提供账户密码。

更多连接串的信息，请参见 [通过 OBClient 连接 OceanBase 租户](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001050310)。

**示例如下：**

```shell
obclient -hxxx.xxx.xxx.xxx -P2881 -utest_user001@mysql001 -p****** -Dtest

```

### 步骤二：在 Tableau Desktop 中连接 OceanBase 数据库

1. 打开 Tableau Desktop，在左侧 **Connect** 一栏的 **To a Server** 区域下，选择 **More** > **MySQL**。
 2. 在 **MySQL** 弹窗中，根据**步骤一：获取 OceanBase 数据库连接串**获取的连接串完成如下配置：

   | 配置项 | 说明 |
   | --- | --- |
   | Server | 取自连接串中 `-h` 参数，OceanBase 数据库连接地址。 |
   | Port | 取自连接串中 `-P` 参数，OceanBase 数据库连接端口。 |
   | Database | 取自连接串中 `-D` 参数，需要访问的数据库名称。 |
   | Username | 取自连接串中 `-u` 参数，账号名称。 |
   | Password | 取自连接串中 `-p` 参数，账号密码。 |
 3. 单击 **Sign In**，连接至 OceanBase 数据库。

   #### 说明

   若您是首次选择 **MySQL** 进行数据库连接，Tableau Desktop 会提示您在连接前需先完成安装 MySQL 驱动。此时，您可按照弹窗提示完成安装所需的 MySQL 驱动后，重新尝试连接。具体安装操作，请参见[MySQL Driver Download](https://www.tableau.com/support/drivers?edition=pro&lang=en-us&platform=mac&cpu=64&version=2024.1&__full-version=20241.24.0308.0326#mysql)。

## 后续操作

完成连接后，您可开始使用 Tableau Desktop。有关 Tableau 的详细操作指南，请参见[Tableau Desktop 官方使用文档](https://help.tableau.com/current/pro/desktop/zh-cn/default.htm)。

 上一篇 下一篇 ![有帮助](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) 咨询热线
