linux - 创建新的 linux 用户时 Postgre 数据库致命错误
问题描述
于是我全新安装了kali linux,并以root用户登录,创建了一个名为gyrgam
个人使用的用户。我输入的第一个命令是createuser gyrgam
,它给了我这个输出
createuser: error: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
我在堆栈上搜索了此问题的解决方案,但我只设法找到如何使用systemctl start postgresql.service
. 现在再次尝试createuser gyrgam
后,它现在给了我这个错误:
createuser: error: could not connect to database postgres: FATAL: role "root" does not exist
我什至确实重新安装了整个 linux,以解决这个问题。在重新安装之前,我当然遇到了同样的问题,我尝试了类似这里或这里的解决方案,但它们要么对我不起作用,要么给了我其他错误。
我的目标是创建一个名为gyrgam
. 但正如解释的那样,我得到了一些 postgres 数据库错误。
解决方案
看来您正在执行错误的命令。如果我理解正确,您想在 linux 中创建操作系统用户。虽然 createuser 命令应该在 postgres 数据库中创建用户。要在 linux 中创建操作系统用户,您应该使用 adduser 命令。请参阅此链接以供参考https://kali.training/topic/managing-users-and-groups/
推荐阅读
- sql - 寻找永远在一起的员工
- algorithm - 堆中公式 n/2^h+1 的确切含义是什么?
- python - 生成 0 到 10 之间数字的 sha1 校验和的 Python 代码
- javascript - 如何将对象转换为按对象键分组
- c# - 保留级联 CheckedListBox 中项目的检查状态
- java - 是否可以从另一个项目中检测实体?
- python-3.x - 具有积分函数的python拟合曲线错误
- algorithm - 计算分区数量的算法?
- android - 加载资源失败:net::ERR_CLEARTEXT_NOT_PERMITTED
- java - 我可以通过 Spring MVC 中的请求参数重载动作吗?