Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL connection when requiring ssl fails. #3994

Closed
Hochen97 opened this issue Dec 3, 2017 · 3 comments
Closed

MySQL connection when requiring ssl fails. #3994

Hochen97 opened this issue Dec 3, 2017 · 3 comments

Comments

@Hochen97
Copy link

Hochen97 commented Dec 3, 2017

Make sure these boxes are checked before submitting your issue - thank you!

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

Superset version

The latest version on docker.
0.20.5 on Debian/python3

Expected results

I am trying to connect to a mysql database which requires the connector to require SSL but does not require an ssl ca. This should just work and has worked before, but I moved to a new host computer and did not remember the work around I had found before.

Actual results

The installation guide shows a snippet for the "connect_args" which should do such, however whenever i enter anything in the connect_args section, all I get is this error:

ERROR: {"error": "Connection failed!\n\nThe error message returned was:\n'sslmode' is an invalid keyword argument for this function"}

Steps to reproduce

SQLAlchemy URI: mysql://:@.sftp.wpengine.com:13306/

Extra section:
{
"metadata_params": {},
"engine_params": {
"connect_args":{
"sslmode":"require"
}
}
}

@mistercrunch
Copy link
Member

Looks like this isn't a Superset problem. Can you connect to your database using SQLAlchemy outside of Superset?

@pecuchet
Copy link

pecuchet commented Dec 6, 2018

For superset version 0.28.1, this worked for me with:

"engine_params": {
  connect_args":{
    "ssl": "require"
  }
}

@muraiki
Copy link

muraiki commented Dec 18, 2018

I needed to use a custom CA, so I did the following:

  1. pip install mysqlconnector
  2. Use a SQLAlchemy URI that uses mysqlconnector (mysql+mysqlconnector://...)
  3. In the Extra JSON block:
{
    "metadata_params": {},
    "engine_params": {
        "connect_args": {
            "ssl_ca": "/path/to/ca.chain.cert"
        }
    },
    "metadata_cache_timeout": {},
    "schemas_allowed_for_csv_upload": []
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants