Files
logan 40b9bdcc8c 落地页/文档面向用户清理:去开发向表述 + 删摆设组件
- 落地页下载卡「Tauri 2」价格位改「原生桌面」;sidecar/Go 二进制/monorepo 脚手架等内部表述改用户语言
- 文档删「打印/导出 PDF」与「是否有帮助」摆设组件及未使用图标
- MCP 页 H1 与页面标题去重(npm 安装命令为用户操作步骤,保留)
- homepage dist 同步重建
2026-10-16 13:20:55 +08:00

192 lines
8.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>新建连接 · OpsxDB 文档</title>
<meta name="description" content="OpsxDB 桌面数据库工作台用户文档 — 连库、写 SQL、看结果;MySQL / PostgreSQL / SQL Server / Oracle / SQLite / Redis 内置驱动,SSH 隧道与 SSL 加密。">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22g%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2264%22%20y2%3D%2264%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23059669%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%2206B6D4%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22url(%23g)%22%2F%3E%3Cg%20stroke%3D%22%23fff%22%20stroke-width%3D%224.5%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%3E%3Cellipse%20cx%3D%2232%22%20cy%3D%2220%22%20rx%3D%2215%22%20ry%3D%226.5%22%2F%3E%3Cpath%20d%3D%22M17%2020v24c0%203.6%206.7%206.5%2015%206.5s15-2.9%2015-6.5V20%22%2F%3E%3Cpath%20d%3D%22M17%2032c0%203.6%206.7%206.5%2015%206.5s15-2.9%2015-6.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E">
<link rel="stylesheet" href="/docs/assets/docs.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" style="display:none" aria-hidden="true">
<symbol id="i-menu" viewBox="0 0 24 24"><path d="M4 5h16"/><path d="M4 12h16"/><path d="M4 19h16"/></symbol>
</svg>
<header class="topbar">
<div class="topbar-inner">
<button class="menu-btn" id="menu-btn" aria-label="打开导航"><svg class="i"><use href="#i-menu"/></svg></button>
<a class="brand" href="/docs">
<span class="brand-logo"><svg width="28" height="28" viewBox="0 0 64 64" aria-label="OpsxDB"><defs><linearGradient id="lg-docs" x1="0" y1="0" x2="64" y2="64" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#059669"/><stop offset="1" stop-color="#06B6D4"/></linearGradient></defs><rect width="64" height="64" rx="14" fill="url(#lg-docs)"/><g stroke="#fff" stroke-width="4.5" fill="none" stroke-linecap="round"><ellipse cx="32" cy="20" rx="15" ry="6.5"/><path d="M17 20v24c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5V20"/><path d="M17 32c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5"/></g></svg></span>
<span class="brand-name">OpsxDB <em>文档</em></span>
</a>
<span class="ver-badge">v0.1</span>
<div class="search">
<input id="search-input" type="search" placeholder="搜索文档…" autocomplete="off" spellcheck="false">
<div class="search-panel" id="search-panel" hidden></div>
</div>
<nav class="top-links">
<a href="/home">官网</a>
<a href="/docs/quickstart">快速开始</a>
</nav>
</div>
</header>
<div class="layout" id="layout">
<aside class="sidebar" id="sidebar">
<div class="nav-group">
<div class="nav-group-title">开始使用</div>
<a class="nav-link" href="/docs/intro">产品介绍</a>
<a class="nav-link" href="/docs/quickstart">快速开始</a>
<a class="nav-link" href="/docs/interface">界面导览</a>
</div>
<div class="nav-group">
<div class="nav-group-title">连接与驱动</div>
<a class="nav-link active" href="/docs/connect">新建连接</a>
<a class="nav-link" href="/docs/drivers">驱动支持</a>
</div>
<div class="nav-group">
<div class="nav-group-title">SQL 工作台</div>
<a class="nav-link" href="/docs/workbench">SQL 工作台</a>
<a class="nav-link" href="/docs/results">结果与导出</a>
<a class="nav-link" href="/docs/redis">Redis 工作台</a>
</div>
<div class="nav-group">
<div class="nav-group-title">安全与 AI</div>
<a class="nav-link" href="/docs/security">安全设计</a>
<a class="nav-link" href="/docs/ai">AI 助手</a>
<a class="nav-link" href="/docs/mcp">MCP 接入</a>
</div>
<div class="nav-group">
<div class="nav-group-title">参考</div>
<a class="nav-link" href="/docs/faq">常见问题</a>
<a class="nav-link" href="/docs/shortcuts">快捷键</a>
</div>
<div class="sidebar-foot">© 2026 OpsxDB · 本地优先的数据库工作台</div>
</aside>
<main class="content">
<div class="breadcrumb">文档 <span>/</span> 连接与驱动 <span>/</span> 新建连接</div>
<h1 class="page-title">新建连接</h1>
<div class="page-meta">更新于 2026-09-20</div>
<article class="md">
<p>本章说明各数据库类型的连接表单、URL 格式与高级选项(SSL / SSH 隧道)。</p>
<h2 id="sec-1">通用流程</h2>
<ol>
<li>连接选择器点「新建」或选某个数据库类型;</li>
<li>填写表单(不同驱动表单不同,见下表);</li>
<li><strong>测试</strong> → 通过后 <strong>保存并连接</strong>。</li>
</ol>
<p>支持直接粘贴 URL 自动填表:</p>
<pre><code>mysql://root:pass@127.0.0.1:3306/shop
postgres://opsx:pass@127.0.0.1:5432/app
</code></pre>
<h2 id="sec-2">各驱动表单</h2>
<table>
<thead>
<tr>
<th>驱动</th>
<th>表单</th>
<th>特有字段</th>
</tr>
</thead>
<tbody>
<tr>
<td>MySQL / PostgreSQL / SQL Server</td>
<td>standard</td>
<td>host · port · user · password · database · ssl · ssh</td>
</tr>
<tr>
<td>Oracle</td>
<td>oracle</td>
<td>host · port · user · password · <strong>service</strong>(如 ORCL)</td>
</tr>
<tr>
<td>SQLite</td>
<td>file</td>
<td>database 填本地文件路径(如 <code>~/data/demo.sqlite</code>)</td>
</tr>
<tr>
<td>Redis</td>
<td>redis</td>
<td>host · port · password · database 序号 · <strong>模式</strong>(单机 / 哨兵 / 集群)· 键分隔符</td>
</tr>
</tbody>
</table>
<p>表单只收集服务端实际消费的字段;历史遗留的死参数不会出现在表单里。</p>
<h2 id="sec-3">MySQL 族与 PostgreSQL 族</h2>
<p>协议兼容的国产库无需单独驱动,直接复用家族驱动:</p>
<ul>
<li><strong>MySQL 族</strong>:MariaDB(3307)、TiDB(4000)、OceanBase(2881)、PolarDB / TDSQL(3306)—— 表单里选对应类型即可;</li>
<li><strong>PostgreSQL 族</strong>:GaussDB / openGauss、人大金仓 Kingbase(54321)—— 走 postgres 表单,注意默认库与用户名差异。</li>
</ul>
<h2 id="sec-4">SSL / TLS</h2>
<p>连接表单中开启 <strong>ssl</strong> 即可;按连接独立配置,互不影响。内网自签证书场景按需放宽校验策略。</p>
<h2 id="sec-5">SSH 隧道</h2>
<p>数据库在跳板机后面时,开启 <strong>ssh</strong> 字段组,填写跳板机地址与凭据:OpsxDB 会先建 SSH 隧道,再把数据库连接走隧道转发,无需把库端口暴露到公网。</p>
<h2 id="sec-6">Redis 哨兵与集群</h2>
<ul>
<li><strong>哨兵</strong>:模式选 Sentinel,填写 Sentinel 节点列表(<code>host:port</code>,多行)和主节点名 <code>masterName</code>;</li>
<li><strong>集群</strong>:模式选 Cluster,填写至少一个种子节点。对象树只显示 DB 0(Cluster 无 <code>SELECT</code>);</li>
<li>单机模式只填 host/port,与原先一致。</li>
</ul>
<p>字段细节与键浏览见 <a href="redis">Redis 工作台</a>。</p>
<blockquote>
<p><strong>提示</strong>:连接保存后,后续查询仅携带 <code>sessionId</code>,账密不会随每次请求上送;密码在本机混淆存储。</p>
</blockquote>
</article>
<div class="pn-nav">
<a class="pn prev" href="/docs/interface"><span class="pn-label">← 上一页</span><span class="pn-title">界面导览</span></a>
<a class="pn next" href="/docs/drivers"><span class="pn-label">下一页 →</span><span class="pn-title">驱动支持</span></a>
</div>
</main>
<aside class="toc">
<div class="toc-title">本页目录</div>
<nav class="toc-nav">
<a class="toc-l2" href="#sec-1">通用流程</a>
<a class="toc-l2" href="#sec-2">各驱动表单</a>
<a class="toc-l2" href="#sec-3">MySQL 族与 PostgreSQL 族</a>
<a class="toc-l2" href="#sec-4">SSL / TLS</a>
<a class="toc-l2" href="#sec-5">SSH 隧道</a>
<a class="toc-l2" href="#sec-6">Redis 哨兵与集群</a>
</nav>
</aside>
</div>
<script src="/docs/assets/docs.js" defer></script>
</body>
</html>