For information on currently supported database types, please refer to: Supported DB Server Types and Versions.
Mavis’s new database connection feature specifically supports connecting to PostgreSQL using the MD5 protocol. Below is some information on how to connect to a PostgreSQL database in Mavis:
Supported Database Connections: Currently supports PostgreSQL connections using the MD5 protocol.
Supported IDEs: This feature has been tested and is supported in pgweb and DBeaver.
Supported Libraries: Compatibility has been verified with Node pg and Node TypeORM.
1. Create a DB Server
1.1 Add a DB Server
Click DB Servers
Click Add DB Server
Enter a custom DB server name
Enter the DB server host IP
Confirm to add
| 1. 點擊 DB 伺服器 2. 點擊 新增 DB 伺服器 3. 輸入 自訂 DB 伺服器名稱 4. 輸入 DB 伺服器 Host IP 5. 確認後 新增 |
1.2 Add DB Server Key
Click Keys
Click Add Key
Enter a custom key name
Click Next
| 1. 點擊 金鑰 2. 點擊 新增金鑰 3. 輸入 自訂金鑰名稱 4. 下一步 |
Select key type: For PostgreSQL, use login password
Select key format for binding to resources: PostgreSQL uses username and password
Enter PostgreSQL username
Enter PostgreSQL password
Click Next
| 5. 選擇金鑰類型:PostgreSQL 使用登入密碼 6. 選擇綁定資產的金鑰格式:PostgreSQL 使用帳號和密碼 7. 輸入 PostgreSQL 帳號 8. 輸入 PostgreSQL 密碼 9. 下一步 |
Complete
| 10. 完成 |
1.3 Create DB Server Access Service
Click Access Services
Click Create Access Service
Enter a custom access service name
Click Next
| 1. 點擊 訪問服務 2. 點擊 建立訪問服務 3. 輸入 自訂訪問服務名稱 4. 下一步 |
Select resource: DB Server
Protocol type: Currently only supports MD5 authentication for PostgreSQL version 13 or below
Enter PostgreSQL port
Enter database name
Click Next
| 5. 資源選擇 DB 伺服器 6. 傳輸協定類別:目前僅支援 PostgreSQL 版本 13 及以下的 MD5 認證方式。 7. 輸入 PostgreSQL 連接埠 8. 輸入 Database 名稱 9. 下一步 |
Confirm key name, type, and account
Click Next
| 10. 確認 金耀名稱、類型、帳號 11. 下一步 |
| 12. 選擇綁定的 DB 伺服器 13. 下一步 |
Complete
| 14. 完成 |
2. Retrieve DB Server Connection Info
Click DB Servers
Click the DB server that has already been added and bound to an access service to view connection info
| 1. 點擊 DB 伺服器 2. 點擊 已添加並綁定訪問服務的 DB 伺服器才會顯示的連線資訊 |
Click Generate Password
| 3. 點擊 產生密碼 |
Obtain DB server connection info and temporary password
| 4. 取得 DB 伺服器連線資訊及臨時密碼 |
3. DB Server Connection Test
3.1 Test Connection Using DBeaver
Open DBeaver and click New Database Connection
Select PostgreSQL
Click Next
| 1. 點擊 新建數據庫連接 2. 選擇 PostgreSQL 3. 下一步 |
Enter the host from the Mavis-generated DB server info (example: jay.mavis.work)
Enter the default database name
Enter the port
Enter the temporary username generated by Mavis
Enter the temporary password generated by Mavis
Complete setup
| 4. 輸入 Mavis 產生的 DB 伺服器資訊 Host 欄位, 此範例 jay.mavis.work 5. 輸入 預設 Database 名稱 6. 輸入 連接埠 7. 輸入 Mavis 產生的臨時帳號 8. 輸入 Mavis 產生的臨時密碼 9. 完成 |
Connection successful
3.2 View DB Server Connection Records
Note: DB server connection records are generated 30 minutes after the DB session disconnects.
Click Connection Records
Find the DB server that has ended its session
Click the
>symbol to view details
| 1. 點擊 連線紀錄 2. 查找 已連線結束後的 DB 伺服器 3. 點擊 > 符號 |