128 lines
3.2 KiB
Plaintext
128 lines
3.2 KiB
Plaintext
---
|
|
title: Database Support
|
|
description: DBX supports 25+ database engines through native Rust drivers.
|
|
---
|
|
|
|
# Database Support
|
|
|
|
DBX supports 25+ database engines through native Rust drivers.
|
|
|
|
## Fully Supported
|
|
|
|
| Database | Driver | Protocol |
|
|
|---|---|---|
|
|
| MySQL | sqlx | MySQL |
|
|
| PostgreSQL | sqlx | PostgreSQL |
|
|
| SQLite | sqlx | Embedded |
|
|
| Redis | redis-rs | RESP |
|
|
| MongoDB | mongodb | MongoDB Wire |
|
|
| DuckDB | duckdb-rs | Embedded |
|
|
| ClickHouse | HTTP client | HTTP |
|
|
| SQL Server | tiberius | TDS |
|
|
| Oracle | oracle-rs | OCI |
|
|
| Elasticsearch | HTTP client | REST |
|
|
| DM (Dameng) | odbc-api | ODBC |
|
|
| GaussDB | odbc-api | ODBC |
|
|
|
|
## MySQL Compatible
|
|
|
|
These databases use MySQL protocol and work with the MySQL driver:
|
|
|
|
| Database | Default Port |
|
|
|---|---|
|
|
| MariaDB | 3306 |
|
|
| TiDB | 4000 |
|
|
| OceanBase | 2881 |
|
|
| GoldenDB | 3306 |
|
|
| Doris | 9030 |
|
|
| SelectDB | 9030 |
|
|
| StarRocks | 9030 |
|
|
| TDengine | 6030 |
|
|
|
|
## PostgreSQL Compatible
|
|
|
|
These databases use PostgreSQL protocol and work with the PostgreSQL driver:
|
|
|
|
| Database | Default Port | Notes |
|
|
|---|---|---|
|
|
| openGauss | 5432 | Use GaussDB (ODBC) if SHA256 auth fails |
|
|
| KingBase | 54321 | |
|
|
| Vastbase | 5432 | |
|
|
| Redshift | 5439 | |
|
|
| CockroachDB | 26257 | |
|
|
|
|
## ODBC Databases
|
|
|
|
DM (Dameng) and GaussDB connect through ODBC, which requires an ODBC driver installed on your system.
|
|
|
|
### DM (Dameng)
|
|
|
|
DM8 connects via the DM ODBC driver. Default port: **5236**, default user: **SYSDBA**.
|
|
|
|
**Linux setup:**
|
|
|
|
```bash
|
|
# Install unixODBC
|
|
sudo apt install unixodbc
|
|
|
|
# Install DM8 (includes ODBC driver)
|
|
# Download from https://eco.dameng.com/download/
|
|
|
|
# Register the driver in /etc/odbcinst.ini
|
|
sudo tee -a /etc/odbcinst.ini << 'EOF'
|
|
[DM8 ODBC DRIVER]
|
|
Description = DM8 ODBC Driver
|
|
Driver = /opt/dmdbms/bin/libdodbc.so
|
|
EOF
|
|
```
|
|
|
|
**Windows setup:**
|
|
|
|
The DM8 installer automatically registers the ODBC driver. No manual configuration needed.
|
|
|
|
**macOS setup:**
|
|
|
|
DM does not provide a native macOS ODBC driver. For development/testing, DM is best accessed from Linux.
|
|
|
|
### GaussDB / openGauss
|
|
|
|
GaussDB connects via ODBC to bypass its custom SHA256 SASL authentication (which standard PostgreSQL drivers don't support). Default port: **5432**, default user: **gaussdb**.
|
|
|
|
> **Tip:** If your openGauss instance uses MD5 authentication, you can connect directly using the PostgreSQL (openGauss) driver without ODBC.
|
|
|
|
**Linux setup:**
|
|
|
|
```bash
|
|
# Install unixODBC
|
|
sudo apt install unixodbc
|
|
|
|
# Download GaussDB ODBC driver from Huawei Cloud
|
|
# https://support.huaweicloud.com/mgtg-dws/dws_01_0032.html
|
|
|
|
# Register the driver in /etc/odbcinst.ini
|
|
sudo tee -a /etc/odbcinst.ini << 'EOF'
|
|
[GaussDBA]
|
|
Description = GaussDB ODBC Driver
|
|
Driver = /usr/lib/odbc/lib/psqlodbcw.so
|
|
EOF
|
|
```
|
|
|
|
**macOS setup (using psqlODBC as a workaround):**
|
|
|
|
```bash
|
|
# Install unixODBC and psqlODBC
|
|
brew install unixodbc psqlodbc
|
|
|
|
# Register as GaussDBA in odbcinst.ini
|
|
DRIVER_PATH=$(find /opt/homebrew/Cellar/psqlodbc -name "psqlodbcw.so" | head -1)
|
|
sudo tee -a /opt/homebrew/etc/odbcinst.ini << EOF
|
|
[GaussDBA]
|
|
Description = GaussDB ODBC Driver (via psqlODBC)
|
|
Driver = $DRIVER_PATH
|
|
EOF
|
|
```
|
|
|
|
**Windows setup:**
|
|
|
|
Download and install the GaussDB ODBC driver from [Huawei Cloud](https://support.huaweicloud.com/mgtg-dws/dws_01_0032.html). The installer registers the driver automatically.
|