将Rails 5应用程序database.yml连接到AWS RDS实例时出错 [英] Error connecting Rails 5 app database.yml to AWS RDS instance

查看:99
本文介绍了将Rails 5应用程序database.yml连接到AWS RDS实例时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经像这样设置了SLL证书:

I already set up SLL certificate like here:

export DATABASE_URL="mysql2://leder:password@pfhpdb.cyo1f7mucyku.eu-central-1.rds.amazonaws.com/pfhpdb?sslca=config/amazon-rds-ca-cert.pem"

在运行带有生产环境和数据库的heroku rails 5应用程序时,出现以下错误:

when running my heroku rails 5 app w/ production environment and DB I get the following error:

ActionView::Template::Error (Can't connect to MySQL server on 'pfhpdb.cyo1f7mucyku.eu-central-1.rds.amazonaws.com' (101 "Network is unreachable")):

我的database.yml如下:

production:
adapter: mysql2
encoding: utf8
host: pfhpdb.cyo1f7mucyku.eu-central-1.rds.amazonaws.com
database: pfhpdb
pool: 5
username: <%= ENV['RDS_USERNAME'] %>
password: <%= ENV['RDS_PASSWORD'] %>

注释:连接到带SQuirreL的RDS时出现相同错误-class java.net.SocketException: Network is unreachable (connect failed)

Comment: same error when connecting to RDS w/ SQuirreL - class java.net.SocketException: Network is unreachable (connect failed)!

更新20200503: 截止到这篇文章: Mariadb连接客户端:用户的访问被拒绝(使用密码:否)在mysql 8.0上

UPDATE 20200503: as of this post: Mariadb connection client: Access denied for user (using password: NO) on mysql 8.0

我无法在MariaDB中使用密码登录,也无法更改数据库表访问权限b/c我无法在MariaDB中使用密码登录.我被数据库关闭了...

I cannot login w/ password in MariaDB and cannot change DB table access b/c I cannot login w/ password in MariaDB. I am shut off from my DB...

推荐答案

最后,通过在RDS控制台设置中重置AWS RDS DB管理员密码来消除身份验证错误.

In the end the authentication error went away by resetting the AWS RDS DB administrator password in the console settings of RDS.

这篇关于将Rails 5应用程序database.yml连接到AWS RDS实例时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆