superset icon indicating copy to clipboard operation
superset copied to clipboard

Cannot connect my superset to sql server.

Open Neel-rishabhsoft opened this issue 6 years ago • 8 comments

Tried the following URIs-

  1. mssql+pymssql://###:$$$@RS004\S16:1433/TLH_Dev
  2. mssql+pymssql://###:$$$@RS004\S16:1433/TLH_Dev/?charset=utf8
  3. mssql+pyodbc://###:$$$@RS004\S16:1433/TLH_Dev
  4. mssql://###:$$$@RS004\S16:1433/TLH_Dev

Expected results

Connection to the SQL Server

Actual results

It shows: For the first two URIs-

  1. ERROR: {"error": "Connection failed!\n\nThe error message returned was:\n(pymssql.InterfaceError) Connection to the database failed for an unknown reason. (Background on this error at: http://sqlalche.me/e/rvf5)", "stacktrace": "Traceback (most recent call last):\n File "src\pymssql.pyx", line 636, in pymssql.connect\n File "src\_mssql.pyx", line 1957, in _mssql.connect\n File "src\_mssql.pyx", line 677, ...

And for the other two URIs- 2. ERROR: {"error": "Connection failed!\n\nThe error message returned was:\n(pyodbc.InterfaceError) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)') (Background on this error at: http://sqlalche.me/e/rvf5)", "stacktrace": "Traceback (most recent call last):\n File "D:\superset\venv\lib\site-packages\sqlalchemy\engine\base.py", line 2228, in _wrap_pool_connect\n return fn()\n File "D:\superset\venv\lib\site-packages\sqlalchemy\pool.py", line 374, in unique_connection\n return

Screenshots

error

Environment

  • superset version: 0.35.2
  • python version: 3.6
  • node.js version: node -v
  • npm version: npm -v

Checklist

  • [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x] I have reproduced the issue with at least the latest released version of superset.
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

I have installed pymssql, pyodbc, mssql, in my environment and the even tried downgrading the sql alachemy. But nothing seems to work.. Please help!!

Neel-rishabhsoft avatar Apr 06 '20 07:04 Neel-rishabhsoft

Anyone has any idea about what can solve this? I have literally tried almost everything.

Neel-rishabhsoft avatar Apr 08 '20 15:04 Neel-rishabhsoft

@mistercrunch

Neel-rishabhsoft avatar Apr 08 '20 15:04 Neel-rishabhsoft

@Neel-rishabhsoft I can probably help, feel free to reach out on Slack.

villebro avatar Apr 08 '20 17:04 villebro

@villebro I'd love to join your slack channel to stay in touch. How do I go about it?

nawazxy avatar Apr 08 '20 20:04 nawazxy

There's the badge on the README.md on the github repo, here's the direct link: https://join.slack.com/t/apache-superset/shared_invite/enQtNDMxMDY5NjM4MDU0LWJmOTcxYjlhZTRhYmEyYTMzOWYxOWEwMjcwZDZiNWRiNDY2NDUwNzcwMDFhNzE1ZmMxZTZlZWY0ZTQ2MzMyNTU

villebro avatar Apr 08 '20 20:04 villebro

This are the steps that I used to connect to MS SQL in Azure :

1 - URI for MSSQL Azure needs the database name after the user name for example : User Name : UserName Password : TestPassword Database : presetSQL.database.windows.net Schema : TestSchema Port : 1433

The URI should be mssql+pymssql://UserName@presetSQL:[email protected]:1433/TestSchema

2- Pass TDS version as parameter. In "Extra" Section modify engine_parameters as follow : { "metadata_params": {}, "engine_params": {"connect_args": {"tds_version": "7.0"}}, "metadata_cache_timeout": {}, "schemas_allowed_for_csv_upload": [] }

@villebro gave me the tips :) maybe it helps you too.

eugeniamz avatar Apr 08 '20 22:04 eugeniamz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Jun 07 '20 22:06 stale[bot]

I am facing the same challenges and unfortunately, the above information does not help me get the MS SQL Server connection to a named instance running.
Any help would be appreciated.

Slack question: https://apache-superset.slack.com/archives/C024WU9LT54/p1650446971125369

rumbin avatar Apr 20 '22 09:04 rumbin