OperationalError:250003:无法获取响应。绞刑?方法:POST
问题描述
我正在尝试使用我的登录凭据连接到Snowflake。我使用以下代码:
snowflake.connector.connect(
user="<my_user_name>",
password="<my_password>",
account="<my_account_name_with_region_and_cloud>"
)
当我尝试运行上述代码时,收到以下错误:
OperationalError:250003:无法获取响应。绞刑?方法:post,url:https://hm53485.us-east-2.aws.snowflakecomputing.com:443/session/v1/login-request?request_id=fcfdd77a-11ff-4956-9ed8-bcc332c5989a&databaseName=S3_DB&schemaName=PUBLIC&warehouse=COMPUTE_WH&request_guid=b9fdb5c9-81cb-4ecb-8d20-abef44249bbf我确信我所有的包都是最新的。我使用的是python 3.6.4和最新的Snowflake_Connector_python。
我当前位于AWS中的us-East-2位置。
有人能帮我一下吗?
解决方案
Just Give your account name in the account .We dont need the region and full URL.
Please check below .
----------------------------------------------------------------------
import snowflake.connector
PASSWORD = '*******'
USER = '<USERNAME>'
ACCOUNT = 'SFCSUPPORT'
WAREHOUSE = '<WHNAME>'
DATABASE = '<DBNAME>'
SCHEMA = 'PUBLIC'
print("Connecting...")
# -- (> ------------------- SECTION=connect_to_snowflake --------------------
con = snowflake.connector.connect(
user=USER,
password=PASSWORD,
account=ACCOUNT,
warehouse=WAREHOUSE,
database=DATABASE,
schema=SCHEMA
)
con.cursor().execute("USE WAREHOUSE " + WAREHOUSE)
con.cursor().execute("USE DATABASE " + DATABASE)
#con.cursor().execute("USE SCHEMA INFORMATION_SCHEMA")
try:
result = con.cursor().execute("Select * from <TABLE>")
result_list = result.fetchall()
print(result_list)
finally:
con.cursor().close()
con.cursor().close()
相关文章