# 访问和操作H2数据库

O2OA默认内嵌了H2数据库，H2数据库支持两种访问方式：

**一、以WEB方式访问数据库**

**二、以客户端形式访问数据库（JDBC）**

## **Web访问** <a href="#h1_1" id="h1_1"></a>

默认访问地址：<http://hostip:20051/>

{% hint style="info" %}
**20051为系统默认的H2数据库访问端口，管理员可以在node\_127.0.0.1.json里对端口进行配置**
{% endhint %}

![连接H2数据库](/files/-LpNZj5aQlGEMacv1lCQ)

**参数说明**

```
Saved Settings: Generic H2 （Server）
Setting Name: Generic H2 （Server）
Driver Class: org.h2.Driver
JDBC URL: jdbc:h2:tcp://localhost:20050/X
User Name：sa
Password: o2
```

{% hint style="info" %}
**20050是平台默认的H2数据库JDBC访问端口，管理员可以在node\_127.0.0.1.json文件中修改该端口配置，passowrd:o2为xadmin密码。**
{% endhint %}

说明：

Password同xadmin密码，平台默认管理员密码为 o2

初次登录管理端，会快较慢，请耐心等待30秒左右。

![WEB客户端访问H2数据库](/files/-LpN_Dt3OYrf7k8XTpcY)

## **客户端访问** <a href="#h1_2" id="h1_2"></a>

推荐客户端软件：开源数据库客户端DBeaver

DBeaver官网：<https://dbeaver.io>  或者 从其他网站下载均可，安装过程此处不做描述。

安装与使用手册：<https://blog.csdn.net/volitationLong/article/details/80583977>

![客户端启动界面](/files/-LpN_Q5amywG8lgE1zqk)

**相关配置说明**

1、新建数据连接

![新建连接](/files/-LpN_aHUQL4-QXnMbiW-)

2、填写连接信息

![填写连接信息](/files/-LpN_heNCekJ6__2_OpG)

**参数说明**

```
JDBC URL: 自动生成
主机：服务器所在的主机IP，如127.0.0.1
端口：默认为20050
数据库/模式：X01
用户名：sa
密码：o2
```

{% hint style="info" %}
**20050是平台默认的H2数据库JDBC访问端口，管理员可以在node\_127.0.0.1.json文件中修改该端口配置，passowrd:o2为xadmin密码。**
{% endhint %}

![客户端访问数据](/files/-LpNa7FzLouMtjRvnaoS)

## **其他数据库访问** <a href="#h1_3" id="h1_3"></a>

其他数据库如Oralce，Mysql，SQLServer等，请自行使用相对应的数据库客户端，此处不做过多赘述。

![Mavicat for MySQL](/files/-LpNaL6G_LcvhgJaiqMk)

![PL/SQL Developer](/files/-LpNaPV6A3HWteohmGoK)

MySQL-Front：

下载地址：<http://www.mysqlfront.de/>

安装与使用教程：<https://www.w3cschool.cn/mysql/mysql-mox12owr.html>

![](/files/-LpNaX_qwtMHi14cP9LZ)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://o2oa.gitbook.io/course/ping-tai-shi-shi/ping-tai-shu-ju-ku-pei-zhi/fang-wen-he-cao-zuo-h2-shu-ju-ku.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
