我的云操作系统是OpenEuler,就像CentOS一样。我想安装postgresql14.2,如下所示:
[root@ecs ~]# dnf -y update
[root@ecs ~]# dnf install -y bc tmux readline-devel zlib zlib-devel tar vim
[root@ecs ~]# groupadd postgres
[root@ecs ~]# useradd -g postgres postgres
[root@ecs ~]# passwd postgres
[root@ecs ~]# wget https://ftp.postgresql.org/pub/source/v14.2/postgresql-14.2.tar.gz
[root@ecs ~]# tar -xzvf postgresql-14.2.tar.gz
[root@ecs ~]# cd postgresql-14.2
[root@ecs ~]# ./configure
[root@ecs ~]# make
[root@ecs ~]# make install
[root@ecs ~]# mkdir /usr/local/pgsql/data
[root@ecs ~]# chown -R postgres:postgres /usr/local/pgsql/data
[root@ecs ~]# su - postgres
[postgres@ecs ~]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data当我运行命令时:
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data我遇到了错误:
-bash: /usr/local/pgsql/bin/initdb: Permission denied我不知道如何处理这种错误,请给我一些建议。非常感谢!
发布于 2022-02-28 09:49:00
我解决了这个麻烦,用:
chown postgres:postgres /usr/local/pgsql -R替换
chown -R postgres:postgres /usr/local/pgsql/datahttps://stackoverflow.com/questions/71290368
复制相似问题