You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "duchuynh (via GitHub)" <gi...@apache.org> on 2023/10/25 15:53:41 UTC
[I] Issue connecting Databases. Tried Postgres and MySQL [superset]
duchuynh opened a new issue, #25755:
URL: https://github.com/apache/superset/issues/25755
A clear and concise description of what the bug is.
#### How to reproduce the bug
Adding all of postgres database login and sql login. Also tried to connect with SQLalchemy link, to no avail.
### Expected results
I expected superset to connect to my database.
### Actual results
error of ERROR: Could not load database driver: MySQLEngineSpec
#### Screenshots
![Screenshot 2023-10-23 134046](https://github.com/apache/superset/assets/1304489/cad1c8e1-9e79-4831-853c-088ec878ac65)
![Screenshot 2023-10-25 114936](https://github.com/apache/superset/assets/1304489/8161ae3b-f154-4195-aaf7-062b80e41460)
### Environment
(please complete the following information):
- browser type and version:
- superset version: `superset version`
- python version: `python --version`
- node.js version: `node -v`
- any feature flags active:
### Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [ ] I have checked the superset logs for python stacktraces and included it here as text if there are 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.
### Additional context
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1783047847
Hi @sfirke after running pip freeze this is the result...
I see the packages of mysqlclient and psycogp2 which are the necessary drivers for the databases.
brendan@VBJMSuperSet:~$ pip freeze
apturl==0.5.2
asn1crypto==1.5.1
bcrypt==3.2.0
blinker==1.4
Brlapi==0.8.3
certifi==2020.6.20
cffi==1.16.0
chardet==4.0.0
charset-normalizer==3.3.1
click==8.0.3
colorama==0.4.4
command-not-found==0.3
cryptography==41.0.4
cupshelpers==1.0
cx-Oracle==8.3.0
dbus-python==1.2.18
defer==1.0.6
distlib==0.3.7
distro==1.7.0
distro-info==1.1+ubuntu0.1
duplicity==0.8.21
fasteners==0.14.1
filelock==3.12.4
future==0.18.2
greenlet==3.0.0
httplib2==0.20.2
idna==3.3
importlib-metadata==4.6.4
jeepney==0.7.1
keyring==23.5.0
language-selector==0.1
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
lockfile==0.12.2
louis==3.20.0
macaroonbakery==1.3.1
Mako==1.1.3
MarkupSafe==2.0.1
monotonic==1.6
more-itertools==8.10.0
mysql==0.0.3
mysql-connector-python==8.1.0
**mysqlclient==1.4.2.post1**
netifaces==0.11.0
oauthlib==3.2.0
olefile==0.46
oscrypto==1.3.0
packaging==23.2
paramiko==2.9.3
pexpect==4.8.0
Pillow==9.0.1
platformdirs==3.11.0
postgres==4.0
protobuf==4.21.12
**psycopg2==2.9.9**
psycopg2-binary==2.9.9
psycopg2-pool==1.1
ptyprocess==0.7.0
pycairo==1.20.1
pycparser==2.21
pycryptodomex==3.19.0
pycups==2.0.1
PyGObject==3.42.1
PyHive==0.7.0
PyJWT==2.3.0
pymacaroons==0.13.0
pymssql==2.2.9
PyNaCl==1.5.0
pyodbc==5.0.1
pyOpenSSL==23.2.0
pyparsing==2.4.7
pyRFC3339==1.1
python-apt==2.4.0+ubuntu2
python-dateutil==2.8.1
python-debian==0.1.43+ubuntu1.1
pytz==2022.1
pyxdg==0.27
PyYAML==5.4.1
reportlab==3.6.8
requests==2.25.1
SecretStorage==3.3.1
six==1.16.0
snowflake-connector-python==3.3.1
snowflake-sqlalchemy==1.5.0
sortedcontainers==2.4.0
SQLAlchemy==1.4.49
sqlalchemy-redshift==0.8.14
systemd-python==234
tomlkit==0.12.1
typing_extensions==4.8.0
ubuntu-advantage-tools==8001
ubuntu-drivers-common==0.0.0
ufw==0.36.1
unattended-upgrades==0.1
urllib3==1.26.5
usb-creator==0.3.7
virtualenv==20.24.5
wadllib==1.3.6
xdg==5
xkit==0.0.0
zipp==1.0.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1789318158
Hooray! I'm glad you got it working. Thanks for sharing your steps and solution, those may be of help to other users in the future. I'll close this issue since you resolved the problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke closed issue #25755: Issue connecting Databases. Tried Postgres and MySQL
URL: https://github.com/apache/superset/issues/25755
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1779921409
Yes Sam in the checklist I mentioned they were both installed successfully
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1781149626
Sorry I missed that. If you run `pip freeze` either on the machine where you installed from scratch or in a container if you are deployed with docker, do you see those packages listed? Just double-checking that part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1789263581
Hi @sfirke , Thanks so much for your time. Your debugging suggestions definitely pointed me in the right direction.
Out of these commands:
sudo apt-get install pkg-config This and the command below worked.
pip install mysqlclient <-- Only this database driver was needed to be installed for MySQL
These are the drivers for the other types of databases, and can be used for connecting through other db types.
pip install cx_Oracle
pip install snowflake-sqlalchemy
pip install pymssql
pip install pyhive
pip install sqlalchemy-redshift
My problem was I did not install the drivers **inside** the Python environment. After you run the sudo apt-get install pkg-config command, superset shuts down, but the command to start superset again is:
superset run -p 8088 --with-threads --reload
Not: superset run -p 8088 --with-threads --reload –debugger <----- This command returns the cryptography error mentioned earlier(not sure why)
After you run everything, then the "MySQL" icon should populate in the superset ui:
![image](https://github.com/apache/superset/assets/1304489/f0cebc06-35d4-486e-ad3e-bed9ae8ca1a9)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1783155091
Unless you meant another way to connect through SQLalchemy. If so, then please advise. Thanks for your time! @sfirke
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1781151171
The next debugging step I'd recommend is opening Python in the location where you installed Superset and trying to connect to the databases via SQLAlchemy. That takes Superset out of the picture and might expose more informative error messages.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1785515001
Hi,
I was able to connect python through SQLAlchemy...
![image](https://github.com/apache/superset/assets/1304489/f13dc89e-5a59-42b4-919c-0d82dc5c3215)
however, it did not give any errors that would point me to a solution. It seems like the connection with SQLalchemy is fine.
Moreover, in the superset UI MySQL isn't an icon for me to choose from. Maybe this could be something?
![image](https://github.com/apache/superset/assets/1304489/fdc67381-061d-4a20-aa56-b2bf3cb1b709)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1785598170
More Information:
I tried to follow this video https://www.youtube.com/watch?v=QBrxYk3nrW8&t=233s to get the MySQL icon to appear, but I after loading all these commands from the video:
sudo apt-get install pkg-config
pip install mysqlclient
pip install cx_Oracle
pip install snowflake-sqlalchemy
pip install pymssql
pip install pyhive
pip install sqlalchemy-redshift
I get this error when starting up Superset
pkg_resources.DistributionNotFound: The 'cryptography<40,>=39.0.1' distribution was not found and is required by apache-superset
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1779915925
Possible duplicate of https://github.com/apache/superset/issues/16096. Have you installed the necessary drivers for those databases? https://superset.apache.org/docs/databases/installing-database-drivers/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1783151331
> The next debugging step I'd recommend is opening Python in the location where you installed Superset and trying to connect to the databases via SQLAlchemy. That takes Superset out of the picture and might expose more informative error messages.
Hi @sfirke
Pasting the error code after messing around in VScode on connecting MySQL
Traceback (most recent call last):
File "/home/brendan/Desktop/my_sql_connect_1.py", line 5, in <module>
connection = mysql.connector.connect(host = "localhost", user = "trial1", password = "password", database = "trial_schema")
File "/usr/lib/python3/dist-packages/mysql/connector/__init__.py", line 173, in connect
return MySQLConnection(*args, **kwargs)
File "/usr/lib/python3/dist-packages/mysql/connector/connection.py", line 102, in __init__
self.connect(**kwargs)
File "/usr/lib/python3/dist-packages/mysql/connector/abstracts.py", line 735, in connect
self._open_connection()
File "/usr/lib/python3/dist-packages/mysql/connector/connection.py", line 250, in _open_connection
self._do_auth(self._user, self._password,
File "/usr/lib/python3/dist-packages/mysql/connector/connection.py", line 172, in _do_auth
self._auth_switch_request(username, password)
File "/usr/lib/python3/dist-packages/mysql/connector/connection.py", line 216, in _auth_switch_request
raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'trial1'@'localhost' (using password: YES)
![image](https://github.com/apache/superset/assets/1304489/6b401490-b6c5-43f9-98cd-32dbf6c97004)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "duchuynh (via GitHub)" <gi...@apache.org>.
duchuynh commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1789264760
After all that, I was able to successfully connect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issue connecting Databases. Tried Postgres and MySQL [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #25755:
URL: https://github.com/apache/superset/issues/25755#issuecomment-1785717389
Sorry this is such a pain. I'm glad you were able to connect via SQLAlchemy, is that from the same machine you are trying to run Superset from? That's a good sign.
What version of Superset are you using? I don't know how those icons for some DBs are chosen. Here's what I see in 3.0.0:
![image](https://github.com/apache/superset/assets/7569808/de7b6fbb-966c-4d82-852d-85f285b42581)
I have these four, even though I didn't install any driver for say Presto. And you shouldn't need the icon, as you can choose from the dropdown - I connect to MS SQL Server and that icon doesn't appear and I use the dropdown, even though I've installed the driver.
I wonder if that cryptography related error came from installing those drivers for DBs you don't need (Redshift, Hive, MS SQL Server, Snowflake) - I would remove the bottom 5 and see if that eliminates the error message.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org