Khi tôi cố gắng để bắt đầu postgresql tôi nhận được một lỗi:"gốc" thực hiện của máy chủ PostgreSQL không được phép
postgres
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.
Vì vậy, sau đó tôi cố gắng thiết lập tập tin cấu hình của tôi:
postgres -D /usr/local/var/postgres
Và tôi nhận được lỗi sau:
postgres cannot access the server configuration file "/usr/local/var/postgres/postgresql.conf": Permission denied
Hmm đuợc. Tiếp theo, tôi cố gắng để thực hiện hành động tương tự như một admin:
sudo postgres -D /usr/local/var/postgres
Và tôi nhận được lỗi sau:
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent possible system security compromise. See the documentation for more information on how to properly start the server.
Tôi googled xung quanh cho rằng thông báo lỗi nhưng không thể tìm thấy một giải pháp.
Có ai có thể cung cấp một số thông tin chi tiết về điều này không?
Làm thế nào để buộc Postgres chạy dưới dạng root nếu tôi thực sự cần điều này dưới docker? – Odysseus
@Odysseus: Bạn không thể. Quá trình máy chủ ('postgres') chủ động từ chối chạy bởi người dùng' root'. Vì sự tỉnh táo. –