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 --versionThe 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/

使用

  • psql -U postgres
  • 获取初始密码: Azure Potal> Boot diagnostics> Log: 885行
    https://docs.bitnami.com/azure/faq/#how-to-find-application-credentials
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'; --更改用户密码

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注