IT评测·应用市场-qidao123.com技术社区

标题: 从 0~1 保姆级 详细版 PostgreSQL 数据库安装教程 [打印本页]

作者: 水军大提督    时间: 5 天前
标题: 从 0~1 保姆级 详细版 PostgreSQL 数据库安装教程
PostgreSQL数据库安装

PostgreSQL官网

【PostgreSQL官网】 | 【PostgreSQL安装官网_Windows】
安装步骤

step1:

选择与电脑相对应的PostgreSQL版本进行下载。

step2:

双击打开刚才下载好的文件。

step3:

step4:

对PostgreSQL进行环境变量配置!
自此,PostgreSQL的环境变量已乐成配置完成!
step5:

尝试登录PostgreSQL
  1. Microsoft Windows [版本 10.0.26100.3775]
  2. (c) Microsoft Corporation。保留所有权利。
  3. C:\Users\31245>pg_ctl start
  4. pg_ctl: 其他服务器进程可能正在运行; 尝试启动服务器进程
  5. 等待服务器进程启动 ....2025-04-19 15:09:51 CST 日志:  日志输出重定向到日志收集进程
  6. 2025-04-19 15:09:51 CST 提示:  后续的日志输出将出现在目录 "log"中.
  7. 完成
  8. 服务器进程已经启动
  9. C:\Users\31245>
复制代码
  1. Microsoft Windows [版本 10.0.26100.3775]
  2. (c) Microsoft Corporation。保留所有权利。
  3. C:\Users\31245>pg_ctl start
  4. pg_ctl: 其他服务器进程可能正在运行; 尝试启动服务器进程
  5. 等待服务器进程启动 ....2025-04-19 15:09:51 CST 日志:  日志输出重定向到日志收集进程
  6. 2025-04-19 15:09:51 CST 提示:  后续的日志输出将出现在目录 "log"中.
  7. 完成
  8. 服务器进程已经启动
  9. C:\Users\31245>
  10. psql -U postgres -p 5432用户 postgres 的口令:psql (17.4)输入 "help" 来获取帮助信息.postgres=#
复制代码
  1. psql (17.4)
  2. 输入 "help" 来获取帮助信息.
  3. postgres=# \l
  4.                                                     数据库列表
  5.    名称    |  拥有者  | 字元编码 | Locale Provider | 校对规则 | Ctype | Locale | ICU Rules |       存取权限
  6. -----------+----------+----------+-----------------+----------+-------+--------+-----------+-----------------------
  7. postgres  | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           |
  8. template0 | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           | =c/postgres          +
  9.            |          |          |                 |          |       |        |           | postgres=CTc/postgres
  10. template1 | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           | =c/postgres          +
  11.            |          |          |                 |          |       |        |           | postgres=CTc/postgres
  12. (3 行记录)
  13. postgres=# create database student;
  14. CREATE DATABASE
  15. postgres=# \l
  16.                                                     数据库列表
  17.    名称    |  拥有者  | 字元编码 | Locale Provider | 校对规则 | Ctype | Locale | ICU Rules |       存取权限
  18. -----------+----------+----------+-----------------+----------+-------+--------+-----------+-----------------------
  19. postgres  | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           |
  20. student   | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           |
  21. template0 | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           | =c/postgres          +
  22.            |          |          |                 |          |       |        |           | postgres=CTc/postgres
  23. template1 | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           | =c/postgres          +
  24.            |          |          |                 |          |       |        |           | postgres=CTc/postgres
  25. (4 行记录)
  26. postgres=# drop database student;
  27. DROP DATABASE
  28. postgres=# \l
  29.                                                     数据库列表
  30.    名称    |  拥有者  | 字元编码 | Locale Provider | 校对规则 | Ctype | Locale | ICU Rules |       存取权限
  31. -----------+----------+----------+-----------------+----------+-------+--------+-----------+-----------------------
  32. postgres  | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           |
  33. template0 | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           | =c/postgres          +
  34.            |          |          |                 |          |       |        |           | postgres=CTc/postgres
  35. template1 | postgres | UTF8     | libc            | zh-CN    | zh-CN |        |           | =c/postgres          +
  36.            |          |          |                 |          |       |        |           | postgres=CTc/postgres
  37. (3 行记录)
  38. postgres=#
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 IT评测·应用市场-qidao123.com技术社区 (https://dis.qidao123.com/) Powered by Discuz! X3.4