加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux上的PostgreSQL“initdb”(数据库初始化)

发布时间:2020-12-14 00:35:19 所属栏目:Linux 来源:网络整理
导读:我正在开发一个在 Linux系统上运行的PostgreSQL 9.x中的数据库集群(单个数据库)(CentOS – RedHat – Fedora).我已经安装了正确的PostgreSQL软件包(服务器和客户端)但是,我无法创建数据库并获得某种类型的初始化依赖项错误:总线错误/退出代码135.我已将用户
我正在开发一个在 Linux系统上运行的PostgreSQL 9.x中的数据库集群(单个数据库)(CentOS – RedHat – Fedora).我已经安装了正确的PostgreSQL软件包(服务器和客户端)但是,我无法创建数据库并获得某种类型的初始化依赖项错误:总线错误/退出代码135.我已将用户更改为“postgres”用“su postgres”然后尝试用“initdb”初始化数据库(这可能是问题)

Installed: postgresql-libs-9.2.13-1.el7_1.x86_64
Installed: postgresql-9.2.13-1.el7_1.x86_64
Installed: postgresql-server-9.2.13-1.el7_1.x86_64

$initdb -D /usr/local/pgsql/data

http://www.postgresql.org/docs/9.2/interactive/creating-cluster.html

错误:

$initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

creating directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... sh: line 1: 12616 Bus error               (core dumped) "/usr/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 > /dev/null
child process exited with exit code 135

有任何想法吗?

解决方法

安装PostgreSQL(服务器和客户端工具)后,需要运行以下命令作为ROOT(“su”).关键步骤是启动“service postgresql initdb”并让它初始化你的PostgreSQL数据库.

如果您有任何错误,则需要删除空安装“data”目录并仔细读取所有日志文件.

# service postgresql initdb
# systemctl enable postgresql
# systemctl start postgresql

完成上述操作后,验证postgres是在/ var / lib / pgsql中运行的进程是否为“ps -ef | grep postgres”(在端口5432上)

如果您遇到任何其他问题,您可能需要创建或修改postgres用户/密码或清理postgres数据目录.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读