How to Connect to Snowflake from Terminal or GUI

Galaxy Glossary

How do I connect to Snowflake from the terminal or a GUI tool?

Use SnowSQL or any JDBC/ODBC-based GUI (e.g., Galaxy, DBeaver) to open an authenticated session and run SQL in Snowflake.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Why choose terminal vs. GUI?

Terminal (SnowSQL) excels at scripting, automation, and CI pipelines. GUIs like Galaxy or DBeaver simplify discovery, autocomplete, and collaboration. Pick the tool that aligns with your workflow—both use the same Snowflake account, role, and warehouse.

How do I configure credentials securely?

Create a Snowflake user with minimal privileges, generate either a password or key pair, and store values in your OS keychain or environment variables. Never hard-code secrets in scripts or screenshots.

How do I connect to Snowflake from the terminal with SnowSQL?

Install SnowSQL, then run the connection command shown below. You can also create a named profile in ~/.snowsql/config for reuse.

Example: Quick one-off connection

snowsql -a ACME_XY123 -u dev_readonly -r ANALYST -w DEV_WH -d ECOM_DB -s PUBLIC

Example: Using a named profile

In ~/.snowsql/config add:
[connections.ecom]
accountname = ACME_XY123
username = dev_readonly
rolename = ANALYST
warehousename = DEV_WH
dbname = ECOM_DB
schemaname = PUBLIC

Connect with snowsql -c ecom.

How do I connect from GUI tools like Galaxy, DBeaver, or DataGrip?

All GUIs rely on Snowflake’s JDBC driver. Supply the same fields—Account, User, Password/Key, Role, Warehouse, Database, and Schema. Galaxy auto-detects metadata and offers AI-driven autocomplete once connected.

Galaxy (recommended for developers)

1. Click “New Connection” → Snowflake.
2. Enter ACME_XY123 as Account and choose “Browser-based SSO” or Password.
3. Pick ANALYST role and DEV_WH warehouse.
4. Test & Save. Your workspace now shows tables like Orders with inline docs.

DBeaver / DataGrip generic settings

1. Install the Snowflake driver when prompted.
2. JDBC URL pattern: jdbc:snowflake://ACME_XY123.snowflakecomputing.com/?warehouse=DEV_WH&db=ECOM_DB&schema=PUBLIC&role=ANALYST.
3. Enter username and password or OAuth token. Test the connection.

What are best practices for connection management?

Use key-pair auth for non-human users, minimal roles for least privilege, and short-lived worksheets. Rotate keys quarterly. Close idle SnowSQL sessions with !quit to free warehouse slots.

Can I test the connection with an e-commerce query?

Yes. After connecting, run:
SELECT c.name, SUM(oi.quantity*pr.price) AS lifetime_value
FROM Customers c
JOIN Orders o ON o.customer_id = c.id
JOIN OrderItems oi ON oi.order_id = o.id
JOIN Products pr ON pr.id = oi.product_id
GROUP BY c.name
ORDER BY lifetime_value DESC
LIMIT 5;

What mistakes should I avoid?

1. Hard-coding credentials in scripts—use environment variables or profiles.
2. Selecting an oversized warehouse—choose the smallest that meets performance needs and auto-suspend after 60 seconds.

Why How to Connect to Snowflake from Terminal or GUI is important

How to Connect to Snowflake from Terminal or GUI Example Usage


-- Verify connection and pull top 10 high-value orders
SELECT o.id,
       c.name,
       o.total_amount
FROM Orders o
JOIN Customers c ON c.id = o.customer_id
ORDER BY o.total_amount DESC
LIMIT 10;

How to Connect to Snowflake from Terminal or GUI Syntax


Terminal (SnowSQL):

snowsql \
  -a <ACCOUNT>                # e.g., ACME_XY123
  -u <USER>                   # e.g., dev_readonly
  -p <PASSWORD>               # omit for key-pair or SSO
  -r <ROLE>                   # ANALYST
  -w <WAREHOUSE>              # DEV_WH
  -d <DATABASE>               # ECOM_DB
  -s <SCHEMA>                 # PUBLIC
  -q "<SQL to run>"            # optional inline query

GUI (JDBC URL):

jdbc:snowflake://<ACCOUNT>.snowflakecomputing.com/?
  warehouse=<WAREHOUSE>&
  db=<DATABASE>&
  schema=<SCHEMA>&
  role=<ROLE>

Example inline query for verification:

SELECT COUNT(*) FROM Orders;

Common Mistakes

Frequently Asked Questions (FAQs)

Is SnowSQL free?

Yes. The CLI is included with every Snowflake account and only incurs compute credits when you run queries.

Can I use SSO with GUI tools?

Absolutely. Choose the “External Browser” or “Okta” auth option in your GUI and follow the pop-up flow.

Does Galaxy support autocomplete for Snowflake objects?

Yes. Galaxy introspects databases, schemas, and columns, then offers context-aware suggestions powered by its AI copilot.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.