连接到Heroku PostgreSQL数据库 [英] Connecting to a Heroku PostgreSQL database

查看:481
本文介绍了连接到Heroku PostgreSQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Rails和Postgres + Heroku的新手。我已经开发了一个网络,就像PHP一样,您可以看到用户输入了哪些记录并使用phpMyAdmin键入了记录,但是Rails呢?我如何查看记录?

Hi i'm totally new to Rails and Postgres + Heroku. I've developed a web and just like PHP you can see what are the records user has entered and key in with phpMyAdmin however what about Rails? How can I see the records?

我已将应用程序上传到Heroku,所以现在我想查看自己的Production数据。不仅如此,我的测试和开发数据也无法在PGAdmin中看到。

I've uploaded the app to Heroku so now I wanna see my Production's data. What is more is that my test and development data can't be seen in PGAdmin as well.

推荐答案

您可以连接到Heroku Postgres就像本地数据库一样。

You can connect to Heroku Postgres just as you can a local database.

转到 https ://postgres.heroku.com/databases ,选择数据库,它将显示连接设置。在页面的最右边,有一个带有两个箭头的图标,选择它会为您提供各种技术的连接字符串,包括psql命令行,您只需将其复制并粘贴到终端即可。

Go to https://postgres.heroku.com/databases, select the database, and it will display the connection settings. On the far right of the page there is an icon with two arrows on it, and selecting it will give you the connection string for various technologies, including a psql command line you can just copy and paste to a terminal.

它将类似于:

psql "dbname=ddgadagin host=ec2-107-12-168-211.compute-1.amazonaws.com user=dgddgargarg password=huu55ihfwqreergr port=5432 sslmode=require"

这篇关于连接到Heroku PostgreSQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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