我正在开发一个在Heroku上运行的简单PHP应用程序.我创建了一个CSV文件,并将其用作简单的数据库.
现在我想在Heroku上创建一个数据库,所以我添加了一个Postgres实例,它的名字是heroku-postgres-9f90a33a::ivory.
我想知道如何创建和管理我的数据库实例以执行创建表等操作.
Yog*_*h D 23
主持人 = ...
数据库 = ...
用户 = ...
港口 = ......
密码 = ...
现在使用PostgreSQL的交互式终端客户端连接到数据库.
如果您还没有安装它,那么您将不得不求助于平台的包管理套件(例如,在Ubuntu上运行sudo apt-get install postgresql-client)或者转到postgresql.org,在那里您可以找到下载适用于FreeBSD,Linux,Mac,Solaris和Windows的预构建二进制包,以及其他安装选项.
To connect, call psql with the -h option to specify the server’s hostname, -U to specify the username, and then the database name:
root@yogesh-System-model:~# psql -h [**Host Name**] -U [**User Name**] [**database Name**]
Password for user hdwvhbehqlishy: ********
psql (8.4.9, server 9.0.5)
WARNING: psql version 8.4, server version 9.0.
Some psql features might not work.
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.
df7r55a12o64m4==> CREATE TABLE [Table_name](your_id SERIAL, Name text, Address text);
Run Code Online (Sandbox Code Playgroud)
这将创造一个表....
我知道这个问题的所有者已经解决了这个问题,但仍然发布这个答案以供将来参考....
如果有任何问题可以参考本教程
这是一种方式.....另一种方式是使用Jack DB,您可以在其中触发任何查询并查看位于Heroku的数据库中的数据.
| 归档时间: |
|
| 查看次数: |
21144 次 |
| 最近记录: |