赞
踩
# su - postgres # 这里是切换到操作系统的postgres用户 $ psql # 缺省用户名的情况下,会把当前系统用户名当作数据库登录用户名,数据库的postgres是超级用户 psql (13.2 (Ubuntu 13.2-1.pgdg18.04+1)) Type "help" for help. postgres=# show config_file; -- 查询配置文件所在位置 config_file ----------------------------------------- /etc/postgresql/13/main/postgresql.conf (1 row) postgres=# show data_directory; -- 查询数据储存目录 data_directory -------------------------- /data/postgresql/13/main (1 row)
# ps -ef|grep postgresql
postgres 23746 1 0 Aug31 ? 00:04:40 /usr/lib/postgresql/13/bin/postgres -D /data/postgresql/13/main -c config_file=/etc/postgresql/13/main/postgresql.conf
可以看到-D
后面的参数即为数据目录,-c
后面的参数即为配置文件所在位置。
转自:https://blog.csdn.net/DongGeGe214/article/details/121489384
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。