找回密码
 立即注册
首页 业界区 安全 Windows 系统安装 OpenGauss 指南

Windows 系统安装 OpenGauss 指南

国瑾瑶 7 天前
Windows 系统安装 OpenGauss 指南

由于 OpenGauss 是主要针对 Linux 系统设计的数据库,官方并不直接提供 Windows 版本,但您可以通过以下方法在 Windows 上运行 OpenGauss:
方法一:使用 Docker(推荐)

这是最简单的方法,适合开发和测试环境。
1. 安装 Docker Desktop


  • 下载并安装 Docker Desktop for Windows
  • 启动 Docker 服务
2. 拉取 OpenGauss 镜像

bash 复制 下载
  1. docker pull enmotech/opengauss
复制代码
3. 运行容器

bash 复制 下载
  1. docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassword@123 -p 5432:5432 enmotech/opengauss:latest
复制代码
4. 连接数据库

使用 pgAdmin 或 DBeaver 等工具连接:

  • 主机:localhost
  • 端口:5432
  • 用户名:gaussdb
  • 密码:YourPassword@123
  • 数据库:postgres
方法二:使用 WSL 2(Windows Subsystem for Linux)

1. 启用 WSL 2


  • 以管理员身份打开 PowerShell 并运行:
powershell 复制 下载
  1. wsl --install
复制代码

  • 重启计算机
2. 安装 Ubuntu 发行版


  • 从 Microsoft Store 安装 Ubuntu 20.04 LTS
  • 启动 Ubuntu 并完成初始设置
3. 在 WSL 中安装 OpenGauss

按照 Linux 安装步骤在 WSL 中安装 OpenGauss(参考之前的 Linux 安装指南)
方法三:虚拟机安装


  • 安装 VirtualBox 或 VMware Workstation Player
  • 创建 Ubuntu 虚拟机
  • 在虚拟机中按照标准 Linux 方法安装 OpenGauss
注意事项


  • 生产环境不建议在 Windows 上运行 OpenGauss
  • Docker 方式最适合开发和测试
  • 性能方面:WSL 2 > 虚拟机 > Docker(Windows版)
  • 某些高级功能可能在 Windows 环境下受限
客户端工具推荐


  • pgAdmin:https://www.pgadmin.org/
  • DBeaver:https://dbeaver.io/
  • DataGrip:https://www.jetbrains.com/datagrip/
如需更稳定的生产环境,建议使用 Linux 服务器或华为云上的 GaussDB 服务。
 
备注:镜像拉取失败,配置镜像
Windows (Docker Desktop):


  • 右键点击任务栏 Docker 图标
  • 选择 "Settings" > "Docker Engine"
  • 添加镜像源配置:
    1. {
    2.   "builder": {
    3.     "gc": {
    4.       "defaultKeepStorage": "20GB",
    5.       "enabled": true
    6.     }
    7.   },
    8.   "experimental": false,
    9.   "registry-mirrors": [
    10.     "https://docker.1ms.run"
    11.   ]
    12. }
    复制代码

  • 点击 "Apply & Restart"

来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
您需要登录后才可以回帖 登录 | 立即注册