简体   繁体   English

如何在digitalOcean上设置PostgreSQL用户名和密码

[英]how to setup PostgreSQL username and password on digitalOcean

Hello I am trying replace my app with the digital Ocean default App but when i try to run, 您好,我正在尝试将我的应用替换为数字海洋默认应用,但是当我尝试运行时,

rails db:setup

i have this error 我有这个错误

fe_sendauth: no password supplied
Couldn't create database for {"adapter"=>"postgresql", 
"encoding"=>"unicode", "pool"=>5, "host"=>"localhost", 
"username"=>"rails", "password"=>nil, 
"database"=>"realestate_development"}
rails aborted!
PG::ConnectionBad: fe_sendauth: no password supplied

Here is my database.yml file 这是我的database.yml文件

pool: 5
host: localhost
username: rails
password: <%= ENV['APP_DATABASE_PASSWORD'] %>

development:
 <<: *default
 database: realestate_development

test:
 <<: *default
 database: realestate_test

production:
 <<: *default
 database: realestate_production
 username: rails
 password: <%= ENV['APP_DATABASE_PASSWORD'] %>

If you follow the steps here , it will ask you for password for postgres user or you could create another user, "rails". 如果您按照此处的步骤操作,它将要求您输入postgres用户的密码,或者您可以创建另一个用户“ rails”。 Then you can update your database.yml with those credentials, especially the password. 然后,您可以使用这些凭据(尤其是密码)更新database.yml。

该消息非常清楚: fe_sendauth:未提供密码在生产中访问Rails控制台并签出ENV ['APP_DATABASE_PASSWORD']值。

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

相关问题 在PostgreSQL中配置用户名和密码 - Configuring Username and Password in PostgreSQL 如何使用环境变量来避免在database.yml中硬编码postgresql的用户名和密码? - How to use environment variable to avoid hard-coding postgresql's username and password in database.yml? 如何使用Rails + Nginx + Postgresql + DigitalOcean访问远程数据库? - How to access remote database with Rails+Nginx+Postgresql+DigitalOcean? 如何使用RestClient发送用户名和密码 - How to send username and password using RestClient 如何保护用户名,密码和api_keys - How to secure username, password, api_keys 如何在mysql控制台中知道我的用户名和密码 - How to know my username and password in mysql console 如果我在Rails上使用Postgresql从database.yml中删除用户名和密码会发生什么 - what happens if i remove username and password from database.yml with postgresql on rails 学习postgresql:下载,设置,尝试在Rails中连接到它,但-username,password失败 - learning postgresql: downloaded it, set it up, trying to connect to it in rails but failing -username,password 将Rails DB设置从数据库名更改为url后,PostgreSQL需要密码 - PostgreSQL requires password after changing Rails DB setup from database name to url ActiveAdmin 用户名或密码无效 - ActiveAdmin username or password invalid
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM