2

I'm a newbie to snowflake and trying to connect to the db using python but when executing the code i get this error "snowflake.connector.errors.ProgrammingError: 251005: User is empty"

import snowflake.connector

ctx = snowflake.connector.connect(

       username = 'xxx',

       password = 'xxxx',

       account = 'xxxx'

       )

cs = ctx.cursor()

try:

  cs.execute(''' some query''')

  one_row = cs.fetchone()

  print(one_row[0])

finally:

  cs.close()

ctx.close()

2 Answers 2

5

You should use "user" parameter instead of "username". Here's sample:

con = snowflake.connector.connect(
    user='XXXX',
    password='XXXX',
    account='XXXX'
)

Please check: https://docs.snowflake.com/en/user-guide/python-connector-example.html#setting-session-parameters

Sign up to request clarification or add additional context in comments.

Comments

0

Also, it's case sensitive (I had the same error message with USER)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.