PostgreSQL on Azure 初始使用

  • publish by Bitnami

创建

进入potal界面
* New> Marketplace> Compute> PostgreSQL(publisher Bitnami)
Bitnami是开源项目不需要money,但azure磁盘管理要,所以乖乖掏钱吧

初始程序

  • Ubuntu 14.04.5 LTS
  • PostgreSQL 9.6.0-1 !!! 已经默认安装了

文档

  • ostgreSQL的version, configuration files, socket, port, log file…
postgres --version

The PostgreSQL configuration settings file is located at /opt/bitnami/postgresql/data/postgresql.conf.
The PostgreSQL client authentication configuration file is located at /opt/bitnami/postgresql/data/pg_hba.conf.
The PostgreSQL official documentation has more details on how to configure the PostgreSQL database.
The socket file is created at /opt/bitnami/postgresql/.s.PGSQL.5432.
The default port in which PostgreSQL listens is 5432.
The main PostgreSQL log file is created at /opt/bitnami/postgresql/data/postgresql.log file

https://docs.bitnami.com/azure/infrastructure/postgresql/

使用

bitnami@rgbspgsql2:~$ psql -U postgres
Password for user postgres:
psql.bin (9.6.0)
Type "help" for help.

postgres=# select version();
                                   version
------------------------------------------------------------------------------
 PostgreSQL 9.6.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.3.0, 64-bit
(1 row)
  • \l : 显示所有数据库
  • \connect database_name: 切换数据库
  • \dt: 显示当前数据库所有表
  • \d + table_name: 显示表的定义
  • date: select now(); select current_time;
  • user:
select session_user,current_user; --显示当前用户  
set session authorization 'test_drupal'; --切换用户
alter user test_drupal with password 'password'; --更改用户密码
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值