| 1 | = PostgreSQL = |
| 2 | |
| 3 | [[PageOutline]] |
| 4 | |
| 5 | == 修改管理者密碼 == |
| 6 | |
| 7 | {{{ |
| 8 | ~$ sudo su - postgres |
| 9 | ~$ psql |
| 10 | postgres=# \password postgres |
| 11 | Enter new password: |
| 12 | Enter it again: |
| 13 | postgres=# \q |
| 14 | }}} |
| 15 | |
| 16 | == 資料庫列表 == |
| 17 | |
| 18 | {{{ |
| 19 | ~$ sudo su - postgres |
| 20 | ~$ psql |
| 21 | postgres=# \l |
| 22 | List of databases |
| 23 | Name | Owner | Encoding | Collate | Ctype | Access privileges |
| 24 | -----------+----------+----------+-------------+-------------+----------------------- |
| 25 | postgres | postgres | UTF8 | zh_TW.UTF-8 | zh_TW.UTF-8 | |
| 26 | template0 | postgres | UTF8 | zh_TW.UTF-8 | zh_TW.UTF-8 | =c/postgres + |
| 27 | | | | | | postgres=CTc/postgres |
| 28 | template1 | postgres | UTF8 | zh_TW.UTF-8 | zh_TW.UTF-8 | =c/postgres + |
| 29 | | | | | | postgres=CTc/postgres |
| 30 | (3 rows) |
| 31 | |
| 32 | }}} |
| 33 | |
| 34 | == 新增使用者 == |
| 35 | |
| 36 | {{{ |
| 37 | ~$ sudo su - postgres |
| 38 | -bash-4.2$ createuser 使用者名稱 |
| 39 | }}} |
| 40 | |
| 41 | == 新增資料庫 == |
| 42 | |
| 43 | {{{ |
| 44 | ~$ sudo su - postgres |
| 45 | -bash-4.2$ createdb 資料庫名稱 |
| 46 | }}} |
| 47 | |