When I try to establish connection to Snowflake server in Navicat (App Store Version), I get an error message saying Snowflake ODBC Driver is required. What is that and what should I do?
updated at
Apply OS: macOS
Apply Navicat Product: Navicat Premium (App Store Version)
Snowflake ODBC Driver is required for connecting to Snowflake database.
Installation Instructions
- Download and install the macOS platform ODBC driver (https://developers.snowflake.com/odbc/)
- Restart Navicat
- Test the connection
Troubleshooting: "Snowflake ODBC Driver is Required"
If Navicat continues to display the message 'Snowflake ODBC Driver is required,' please follow these additional steps to install the Snowflake ODBC driver in a location accessible by the Navicat App Store version.
- Copy the Script:
Copy the following script and save it as a configure_snowflake_odbc.sh script file on your macOS device.
#!/bin/bash
# Step 2: Verify the Driver Installation
echo "Step 2: Verifying Snowflake ODBC driver installation..."
# Check if the driver files exist in /opt/snowflake
if [ ! -d "/opt/snowflake" ]; then
echo "Error: Snowflake ODBC driver not found in /opt/snowflake."
exit 1
fi
echo "Snowflake ODBC driver found in /opt/snowflake."
# Check if the driver entry exists in ~/Library/ODBC/odbcinst.ini or /Library/ODBC/odbcinst.ini
USER_ODBCINST_INI="$HOME/Library/ODBC/odbcinst.ini"
SYSTEM_ODBCINST_INI="/Library/ODBC/odbcinst.ini"
if [ -f "$USER_ODBCINST_INI" ] && grep -q "\[Snowflake\]" "$USER_ODBCINST_INI"; then
echo "Snowflake driver entry found in $USER_ODBCINST_INI."
DRIVER_ENTRY=$(grep -A 1 "\[Snowflake\]" "$USER_ODBCINST_INI")
elif [ -f "$SYSTEM_ODBCINST_INI" ] && grep -q "\[Snowflake\]" "$SYSTEM_ODBCINST_INI"; then
echo "Snowflake driver entry found in $SYSTEM_ODBCINST_INI."
DRIVER_ENTRY=$(grep -A 1 "\[Snowflake\]" "$SYSTEM_ODBCINST_INI")
else
echo "Error: Snowflake driver entry not found in $USER_ODBCINST_INI or $SYSTEM_ODBCINST_INI."
exit 1
fi
# Step 3: Create or Update /Library/ODBC/odbcinst.ini
echo "Step 3: Creating or updating /Library/ODBC/odbcinst.ini..."
# Create /Library/ODBC directory if it doesn't exist
sudo mkdir -p /Library/ODBC
# Create /Library/ODBC/odbcinst.ini if it doesn't exist
if [ ! -f "$SYSTEM_ODBCINST_INI" ]; then
sudo touch "$SYSTEM_ODBCINST_INI"
echo "Created $SYSTEM_ODBCINST_INI."
fi
# Ensure the [ODBC Drivers] section exists
if ! grep -q "\[ODBC Drivers\]" "$SYSTEM_ODBCINST_INI"; then
echo "[ODBC Drivers]" | sudo tee -a "$SYSTEM_ODBCINST_INI" > /dev/null
echo "Snowflake = Installed" | sudo tee -a "$SYSTEM_ODBCINST_INI" > /dev/null
echo "Added [ODBC Drivers] section to $SYSTEM_ODBCINST_INI."
fi
# Add the Snowflake entry under [ODBC Drivers] if it doesn't exist
if ! grep -q "Snowflake[[:space:]]*=" "$SYSTEM_ODBCINST_INI"; then
sudo sed -i '' '/\[ODBC Drivers\]/a\
Snowflake = Installed
' "$SYSTEM_ODBCINST_INI"
echo "Added Snowflake entry under [ODBC Drivers] in $SYSTEM_ODBCINST_INI."
else
echo "Snowflake entry already exists under [ODBC Drivers] in $SYSTEM_ODBCINST_INI."
fi
# Add the Snowflake driver entry to /Library/ODBC/odbcinst.ini
if ! grep -q "\[Snowflake\]" "$SYSTEM_ODBCINST_INI"; then
# Append two newlines before the [Snowflake] section
echo "" | sudo tee -a "$SYSTEM_ODBCINST_INI" > /dev/null
echo "" | sudo tee -a "$SYSTEM_ODBCINST_INI" > /dev/null
# Append the Snowflake driver entry
echo "$DRIVER_ENTRY" | sudo tee -a "$SYSTEM_ODBCINST_INI" > /dev/null
echo "Added Snowflake driver entry to $SYSTEM_ODBCINST_INI."
else
echo "Snowflake driver entry already exists in $SYSTEM_ODBCINST_INI."
fi
# Step 4: Copy the Driver to a Sandbox-Accessible Location
echo "Step 4: Copying Snowflake driver to /Library/ODBC/snowflake..."
# Create /Library/ODBC/snowflake directory if it doesn't exist
sudo mkdir -p /Library/ODBC/snowflake
# Copy the driver files to /Library/ODBC/snowflake
sudo cp -r /opt/snowflake/* /Library/ODBC/snowflake/
echo "Copied Snowflake driver files to /Library/ODBC/snowflake."
# Step 5: Update the ODBC Configuration
echo "Step 5: Updating ODBC configuration..."
# Update the driver path in /Library/ODBC/odbcinst.ini
sudo sed -i '' 's|Driver[[:space:]]*=[[:space:]]*/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib|Driver = /Library/ODBC/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib|g' "$SYSTEM_ODBCINST_INI"
echo "Updated driver path in $SYSTEM_ODBCINST_INI."
# Find and update paths in simba.snowflake.ini
echo "Updating paths in simba.snowflake.ini..."
# Search for simba.snowflake.ini in all directories under /Library/ODBC/snowflake/
find /Library/ODBC/snowflake -type f -name "simba.snowflake.ini" | while read -r file; do
echo "Found simba.snowflake.ini at: $file"
# Update paths starting with /opt/snowflake to /Library/ODBC/snowflake
sudo sed -i '' 's|/opt/snowflake|/Library/ODBC/snowflake|g' "$file"
echo "Updated paths in $file."
done
echo "Configuration completed successfully!" - Open Terminal:
Open the Terminal application on your macOS device.
- Make the Script Executable:
Navigate to the directory where you saved the configure_snowflake_odbc.sh file.
Make the script executable by running the following command:chmod +x configure_snowflake_odbc.sh
- Run the Script with sudo:
Execute the script with administrative privileges by running:sudo ./configure_snowflake_odbc.sh
- Test the connection
Have more questions?
-
Support
-
About Us