Documentation

Execute SQL queries with ODBC

Use the Arrow Flight SQL ODBC driver to execute SQL queries against InfluxDB Cloud Serverless from ODBC-compatible applications and programming languages.

ODBC (Open Database Connectivity) is a standard API for accessing database management systems. The Arrow Flight SQL ODBC driver enables ODBC-compatible applications to connect to InfluxDB Cloud Serverless and query data using SQL.

Download and install the ODBC driver

InfluxDB Cloud Serverless uses the Arrow Flight SQL ODBC driver to enable ODBC connectivity.

For more information about the Arrow Flight SQL ODBC Driver, see the Dremio documentation.

Run the following PowerShell commands to download and install:

# Set the driver path
$driverPath = "C:\Users\
YOUR_USER
\Downloads\arrow-flight-sql-odbc-0.9.7.1195-win64.msi"
# Download the driver Invoke-WebRequest -Uri "https://docs.influxdata.com/downloads/arrow-flight-sql-odbc-0.9.7.1195-win64.msi" ` -OutFile $driverPath # Mark as trusted Unblock-File $driverPath # Install Start-Process msiexec.exe -Wait -ArgumentList "/i `"$driverPath`""

Replace the following:

  • YOUR_USER: Your Windows username

Verify installation

  1. Open ODBC Data Source Administrator (64-bit)
  2. Navigate to the Drivers tab
  3. Verify Arrow Flight SQL ODBC Driver appears in the list

Download the Arrow Flight SQL ODBC driver

  1. Run the downloaded .msi installer
  2. Follow the installation wizard using default settings
  3. Complete the installation

Verify installation

  1. Open ODBC Data Source Administrator (64-bit)
  2. Navigate to the Drivers tab
  3. Verify Arrow Flight SQL ODBC Driver appears in the list

Download from Dremio:

Install on macOS

  1. Run the downloaded .pkg installer
  2. Follow the installation prompts
  3. Enter your administrator password when prompted
  4. Complete the installation

Install on Linux

  1. Extract the downloaded archive:

    tar -xzf arrow-flight-sql-odbc-LATEST-linux-x86_64.tar.gz
  2. Install the driver (installation location may vary by distribution):

    sudo mkdir -p /opt/arrow-flight-sql-odbc
    sudo cp -r lib /opt/arrow-flight-sql-odbc/
  3. Configure the driver in /etc/odbcinst.ini:

    [Arrow Flight SQL ODBC Driver]
    Description = Arrow Flight SQL ODBC Driver
    Driver = /opt/arrow-flight-sql-odbc/lib/libarrow-odbc.so

Verify installation

To verify the driver is installed correctly, run:

odbcinst -q -d

The output should include Arrow Flight SQL.

Configure a data source

After installing the Arrow Flight SQL ODBC driver, configure a data source to connect to InfluxDB Cloud Serverless.

  1. Open ODBC Data Source Administrator (64-bit)

  2. Navigate to the System DSN or User DSN tab

  3. Click Add

  4. Select Arrow Flight SQL ODBC Driver and click Finish

  5. Configure the connection:

    • Data Source Name: Provide a descriptive name (for example, InfluxDB3)
    • Host: Your InfluxDB Cloud Serverless host (for example, us-west-2-1.aws.cloud2.influxdata.com)
    • Port: Your InfluxDB URL port (for example, 443 (HTTPS))
    • Database: Your database name
    • Auth Token: Your token
    • Use Encryption: Enable for HTTPS connections
  6. Click Test to verify the connection

  7. Click OK to save

Create or edit ~/.odbc.ini (user DSN) or /etc/odbc.ini (system DSN):

[InfluxDB3]
Driver = Arrow Flight SQL ODBC Driver
Host = us-west-2-1.aws.cloud2.influxdata.com
Port = 443
Database = 
DATABASE_NAME
AuthToken =
DATABASE_TOKEN
UseEncryption = 1

Replace the following:

Test the connection:

isql -v InfluxDB3

Connect and query from applications

After configuring a data source, connect from ODBC-compatible applications:

Power BI

See Use Power BI to visualize data.

Tableau

See Use Tableau to visualize data.

Excel

  1. Open Excel
  2. Go to Data > Get Data > From Other Sources > From ODBC
  3. Select your InfluxDB data source
  4. Enter credentials if prompted
  5. Select tables and load data

DBeaver

  1. Create a new database connection
  2. Select ODBC as the connection type
  3. Configure the connection:
    • Database/Schema: Your InfluxDB database
    • ODBC DSN: Your configured data source name
  4. Test and save the connection

Use ODBC with programming languages

Python with pyodbc

import pyodbc

# Connect to InfluxDB
conn = pyodbc.connect(
    'DSN=InfluxDB3',
    autocommit=True
)

# Create cursor
cursor = conn.cursor()

# Execute query
cursor.execute("""
    SELECT
        time,
        temp,
        location
    FROM
        home
    WHERE
        time >= now() - INTERVAL '1 hour'
    ORDER BY
        time DESC
""")

# Fetch results
for row in cursor.fetchall():
    print(row)

# Close connection
cursor.close()
conn.close()

R with RODBC

library(RODBC)

# Connect to InfluxDB
conn <- odbcConnect("InfluxDB3")

# Execute query
result <- sqlQuery(conn, "
    SELECT
        time,
        temp,
        location
    FROM
        home
    WHERE
        time >= now() - INTERVAL '1 hour'
    ORDER BY
        time DESC
")

# View results
print(result)

# Close connection
odbcClose(conn)

C# with System.Data.Odbc

using System;
using System.Data.Odbc;

class Program
{
    static void Main()
    {
        string connectionString = "DSN=InfluxDB3";

        using (OdbcConnection conn = new OdbcConnection(connectionString))
        {
            conn.Open();

            string query = @"
                SELECT
                    time,
                    temp,
                    location
                FROM
                    home
                WHERE
                    time >= now() - INTERVAL '1 hour'
                ORDER BY
                    time DESC
            ";

            using (OdbcCommand cmd = new OdbcCommand(query, conn))
            using (OdbcDataReader reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    Console.WriteLine($"{reader["time"]} - {reader["temp"]} - {reader["location"]}");
                }
            }
        }
    }
}

Connection string format

For applications that use connection strings directly:

Driver={Arrow Flight SQL ODBC Driver};Host=HOST;Port=PORT;Database=DATABASE;AuthToken=TOKEN;UseEncryption=1

Example:

Driver={Arrow Flight SQL ODBC Driver};Host=localhost;Port=8181;Database=
DATABASE_NAME
;AuthToken=
DATABASE_TOKEN
;UseEncryption=1

For InfluxDB Cloud Serverless, use port 443:

Driver={Arrow Flight SQL ODBC Driver};Host=cluster-id.a.influxdb.io;Port=443;Database=
DATABASE_NAME
;AuthToken=
DATABASE_TOKEN
;UseEncryption=1

Configuration options

Connection parameters

ParameterDescriptionDefault
HostInfluxDB server hostnameRequired
PortInfluxDB server portRequired
DatabaseDatabase nameRequired
AuthTokenAuthentication tokenRequired
UseEncryptionUse encrypted connection1 (enabled)
TrustedCertsPath to trusted CA certificatesSystem default
DisableCertificateVerificationSkip certificate verification0 (disabled)

Advanced options

Add these to your DSN configuration or connection string as needed:

[InfluxDB3]
Driver = Arrow Flight SQL ODBC Driver
Host = us-west-2-1.aws.cloud2.influxdata.com
Port = 443
Database = mydb
AuthToken = your-token
UseEncryption = 1
DisableCertificateVerification = 0

Troubleshooting

Driver not found

If applications cannot find the Arrow Flight SQL ODBC driver:

  1. Open ODBC Data Source Administrator (64-bit)
  2. Navigate to the Drivers tab
  3. Verify Arrow Flight SQL ODBC Driver appears in the list
  4. If not listed, reinstall the driver
  1. Run the following command to list installed drivers:

    odbcinst -q -d
  2. Verify Arrow Flight SQL appears in the output

  3. Check /etc/odbcinst.ini for proper driver configuration

  4. Ensure the driver library path is correct

Connection failures

If you cannot connect to InfluxDB Cloud Serverless:

  • Verify your InfluxDB Cloud Serverless instance is running and accessible
  • Check host and port settings:
    • Local instances: localhost:8181
    • InfluxDB Cloud Serverless: Use your cluster URL with port 443
  • Ensure UseEncryption is set correctly for your connection type
  • Verify network connectivity and firewall rules allow connections

Authentication errors

If authentication fails:

  • Confirm your token is valid and not expired
  • Ensure the token is specified in the AuthToken parameter (not Token)
  • Check that the token was copied correctly without extra spaces or characters

Query errors

If queries fail or return errors:

  • Verify SQL syntax is correct for InfluxDB SQL
  • Check that referenced tables (measurements) exist in the database
  • Ensure column names match your schema
  • Review the SQL reference for supported features
  • For large result sets, consider adding LIMIT clauses

Performance issues

For slow queries or connection timeouts:

  • Add time range filters to limit data scanned
  • Use appropriate indexes if available
  • Increase timeout values in your DSN configuration
  • Monitor query execution plans for optimization opportunities

Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.5

Key enhancements in InfluxDB 3.5 and the InfluxDB 3 Explorer 1.3.

See the Blog Post

InfluxDB 3.5 is now available for both Core and Enterprise, introducing custom plugin repository support, enhanced operational visibility with queryable CLI parameters and manual node management, stronger security controls, and general performance improvements.

InfluxDB 3 Explorer 1.3 brings powerful new capabilities including Dashboards (beta) for saving and organizing your favorite queries, and cache querying for instant access to Last Value and Distinct Value caches—making Explorer a more comprehensive workspace for time series monitoring and analysis.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On November 3, 2025, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2

InfluxDB Cloud Serverless