简体   繁体   English

Linux 与其他用户一起启动 PostgreSQL

[英]Linux start PostgreSQL with other user

I have a NTFS drive mounted on linux.我在 linux 上安装了一个 NTFS 驱动器。 I want to move postgres data directory to that drive but when I try to start the service I get a 'FATAL: data directory.. has wrong ownership'我想将 postgres 数据目录移动到该驱动器,但是当我尝试启动服务时,我得到一个“致命:数据目录..拥有错误的所有权”

I know that this is happening because the owner of the data directory is me (my linux user) instead of the user postgres but I cannot change the ownership of the directory because of how the drive is mounted in the fstab file:我知道发生这种情况是因为数据目录的所有者是我(我的 linux 用户)而不是用户 postgres,但由于驱动器在 fstab 文件中的安装方式,我无法更改目录的所有权:

UUID=E8B4580DB457DC9E /mnt/Data ntfs defaults,uid=1000,gid=1000,rw 0 0
  • Tried adding my user the to postgres group but didn't work.尝试将我的用户添加到 postgres 组,但没有奏效。

  • I also tried mounting the driver as follows:我还尝试按如下方式安装驱动程序:

    UID=E8B4580DB457DC9E /mnt/Data ntfs auto,users,permissions 0 0 UID=E8B4580DB457DC9E /mnt/Data ntfs auto,users,permissions 0 0

I was able to change the ownership of the directory with this change but then the node packages were giving 'permission access' problem upon running or installation我能够通过此更改更改目录的所有权,但随后节点包在运行或安装时出现“权限访问”问题

Manage to solve it by creating a partition for the databases and mounting that partition with UID=E8B4580DB457DC9E /mnt/Data ntfs auto,users,permissions 0 0设法通过为数据库创建分区并使用 UID=E8B4580DB457DC9E /mnt/Data ntfs auto,users,permissions 0 0 挂载该分区来解决它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM