Logging into Snowflake¶
In the early stages of getting started with Snowflake, we recommend logging in using either the web-based user interface or SnowSQL (the command line client available for download from the interface).
Then, once you’re more familiar with Snowflake, you can explore connecting to Snowflake using other methods.
In this Topic:
Your Snowflake Account Name¶
All access to Snowflake is either through your account name (provided by Snowflake) or a URL that uses the following format:
https://account_name.snowflakecomputing.com
However, note that your full account name may include additional segments that identify the region and cloud platform where your account is hosted.
Account name examples by region
If your account locator is xy12345
:
Cloud Platform / . Region |
Account Locator . (with additional segments if required) |
---|---|
Amazon Web Services (AWS) |
|
US West (Oregon)
|
|
US East (Ohio)
|
|
US East (N. Virginia)
|
|
US East (Commercial Gov - N. Virginia)
|
|
Canada (Central)
|
|
EU (Ireland)
|
|
Europe (London)
|
|
EU (Frankfurt)
|
|
Asia Pacific (Tokyo)
|
|
Asia Pacific (Mumbai)
|
|
Asia Pacific (Singapore)
|
|
Asia Pacific (Sydney)
|
|
Google Cloud Platform (GCP) |
|
US Central1 (Iowa)
|
|
Europe West2 (London)
|
|
Europe West4 (Netherlands)
|
|
Microsoft Azure |
|
West US 2 (Washington)
|
|
East US 2 (Virginia)
|
|
US Gov Virginia
|
|
Canada Central (Toronto)
|
|
West Europe (Netherlands)
|
|
Switzerland North (Zurich)
|
|
Southeast Asia (Singapore)
|
|
Australia East (New South Wales)
|
|
Important
If either of the following conditions is true, your account locator is different than the structure described in the above examples:
If your Snowflake Edition is VPS, please contact Snowflake Support for details about your account locator.
If AWS PrivateLink or Azure Private Link is enabled for your account and you wish to use private connectivity to connect to Snowflake, run the SYSTEM$GET_PRIVATELINK_CONFIG function to determine the private connectivity URL to use.
For more details on private connectivity, see:
Logging in Using the Web Interface¶
To log into the Snowflake web interface:
Point your browser at the hostname provided by Snowflake for your account (see previous section for details). Note that the URL must start with
https://
.If your web browser is able to communicate with the Snowflake service, the following login screen is displayed:
Enter your credentials (user login name and password) and click Log In.
For more information about the tasks you can perform in the web interface, see Quick Tour of the Web Interface.
Logging in Using SnowSQL¶
SnowSQL is the command line client for connecting to Snowflake to execute SQL queries and perform all DDL and DML operations, including loading data into and unloading data out of database tables.
Step 1: Download and Install SnowSQL¶
The SnowSQL installer is available for download from the Snowflake Client Repository. No authentication is required. This version of the SnowSQL installer enables auto-upgrade for patches.
For more detailed instructions, see Installing SnowSQL.
To install SnowSQL:
Open a terminal window.
Run
curl
to download the SnowSQL installer.For increased flexibility, Snowflake provides both Amazon Web Services (AWS) and Azure endpoints for downloading the SnowSQL installer. Accounts hosted on any supported cloud platform can download the installer from either endpoint.
Linux
- AWS endpoint
$ curl -O https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.14-linux_x86_64.bash
- Microsoft Azure endpoint
$ curl -O https://sfc-repo.azure.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.14-linux_x86_64.bash
macOS
- AWS endpoint
$ curl -O https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/<bootstrap_version>/darwin_x86_64/snowsql-<version>-darwin_x86_64.pkg
- Microsoft Azure endpoint
$ curl -O https://sfc-repo.azure.snowflakecomputing.com/snowsql/bootstrap/<bootstrap_version>/darwin_x86_64/snowsql-<version>-darwin_x86_64.pkg
Windows
- AWS endpoint
$ curl -O https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/windows_x86_64/snowsql-1.2.14-windows_x86_64.msi
- Microsoft Azure endpoint
$ curl -O https://sfc-repo.azure.snowflakecomputing.com/snowsql/bootstrap/1.2/windows_x86_64/snowsql-1.2.14-windows_x86_64.msi
Run the installer:
Linux
Open a terminal window.
Run the Bash script installer from the download location:
$ bash snowsql-linux_x86_64.bash
Follow the instructions provided by the installer.
macOS
Double-click
snowsql-darwin_x86_64.pkg
in the download location to run the installer PKG file.Follow the instructions provided by the installer.
Windows
Double-click
snowsql-windows_x86_64.msi
in the download location to run the installer MSI file.Follow the instructions provided by the installer.
Configuring the Z Shell Alias (macOS Only)¶
If Z shell (also known as zsh) is your default terminal shell, set an alias to the SnowSQL executable so that you can run SnowSQL on the command line in Terminal. The SnowSQL installer installs the executable in /Applications/SnowSQL.app/Contents/MacOS/snowsql
and appends this path to the PATH or alias entry in ~/.profile
. Because zsh does not normally read this file, add an alias to this path in ~/.zshrc
, which zsh does read.
To add an alias to the SnowSQL executable:
Open (or create, if missing) the
~/.zshrc
file.Add the following line:
alias snowsql=/Applications/SnowSQL.app/Contents/MacOS/snowsql
Save the file.
Step 2: Connect to Snowflake and Initiate a Session¶
From a terminal window, start SnowSQL from the command prompt using the following command:
$ snowsql -a <account_name>
Where
<account_name>
is the name assigned by Snowflake. Note that when you specify your account name, you do not include the Snowflake domain name (i.e.snowflakecomputing.com
). You only include the account name (with region and cloud platform information, if necessary). For more details, see Your Snowflake Account Name (in this topic).You can further streamline login by specifying the
-u
option followed by your user login name:$ snowsql -a <account_name> -u <user_login_name>
When prompted, enter your login name (if you didn’t provide it when executing SnowSQL) and your password.
If you specified a valid account name, user login name, and password, the SnowSQL prompt appears.
Tip
For security reasons, you cannot specify your password as an option on the command line; you must wait for SnowSQL to prompt you for your password.
However, if you would like to skip entering information on the command line or you need to automate login, you can provide all the required account and user credential information, as well as additional
Snowflake default usage information, as options in the SnowSQL config
file.
For more detailed installation, configuration, login, and usage information, see SnowSQL (CLI Client).
Connecting Using Other Methods¶
In addition to the Snowflake web interface and SnowSQL, Snowflake supports numerous other methods for connecting, including:
Using 3rd-party client services and applications that support JDBC or ODBC.
Developing applications that connect through the Snowflake connectors/drivers for Python, Node.js, Spark, etc.
However, connecting to Snowflake using these other methods requires additional installation, configuration, and development tasks. For more information, see Connecting to Snowflake.