可以在Manjaro上启动Postgresql 21.2.5

发布于 2025-01-19 03:06:49 字数 1281 浏览 2 评论 0原文

我无法在 VirtualBox 内运行的 Manjaro 21.2.5 上启动 PostgreSQL 13.6。 如何让 PostgreSQL 与 Manjaro 一起工作? 我使用 Manjaro 包管理器下载了 PostgreSQL。 谢谢你!

    ~  psql                                                             ✔ 
psql: error: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/run/postgresql/.s.PGSQL.5432"?
    ~  postgres                                                       2 ✘ 
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
    ~                                                                 2 ✘ 
    ~  sudo systemctl status postgresql                             INT ✘ 
[sudo] password for jon: 
○ postgresql.service - PostgreSQL database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vend>
     Active: inactive (dead)
    ~  sudo systemctl start postgresql                        3 ✘  25s  
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xeu postgresql.service" for details.

I cannot start PostgreSQL 13.6 on Manjaro 21.2.5 running inside VirtualBox.
How to get PostgreSQL to work with Manjaro?
I downloaded PostgreSQL using the Manjaro package manager.
Thank you!

    ~  psql                                                             ✔ 
psql: error: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/run/postgresql/.s.PGSQL.5432"?
    ~  postgres                                                       2 ✘ 
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
    ~                                                                 2 ✘ 
    ~  sudo systemctl status postgresql                             INT ✘ 
[sudo] password for jon: 
○ postgresql.service - PostgreSQL database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vend>
     Active: inactive (dead)
    ~  sudo systemctl start postgresql                        3 ✘  25s  
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xeu postgresql.service" for details.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一直在等你来 2025-01-26 03:06:49

您是否初始化了数据库?

initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/'

您可能还需要在运行psql通过SytemCtl之前启动服务:如果您还没有:

sudo systemctl enable --now postgresql.service

Have you initialized the database?

initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/'

You might also need to start the service before running psql through systemctl if you haven't already:

sudo systemctl enable --now postgresql.service
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文