gpt4 book ai didi

postgresql - 无法启动 postgresql.service?

转载 作者:行者123 更新时间:2023-11-29 11:20:22 31 4
gpt4 key购买 nike

我正在使用 arch linux (4.8.13-1-ARCH)。我正尝试按照说明设置 PostgreSQL here .

执行后

[postgres@BitBox ~]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/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.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgres/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

pg_ctl -D /var/lib/postgres/data -l logfile start

成功地,我使用退出命令返回到我的普通用户。

[postgres@BitBox ~]$ exit
logout

然后,在尝试启动 postgresql.service 时,出现以下错误:

[code_master5@BitBox ~]$ sudo systemctl start postgresql.service
Failed to start postgresql.service: Unit postgresql.service not found.

我什至没有得到服务的状态:

[code_master5@BitBox ~]$ sudo systemctl status postgresql.service
Unit postgresql.service could not be found.

我卡住了!

最佳答案

试试这个:

service postgresql-10.service restart
service postgresql-XX.service restart

关于postgresql - 无法启动 postgresql.service?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41867841/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com