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
Connecting MySQL and PostgreSQL into SQLAlchemy URI #5013
Comments
The error is pretty clear and requirements for databases are in the documentation. |
@xrmx I followed the docs but can not still connect. Can you please point me out what to install (either in Ubuntu or Windows)? The syntax for (2) user / pass / db after the (1) mysql+mysqldb (2) scott:tiger@localhost/foo, is clear, but the (1) is the problem I can not solve. |
@mistercrunch Can you please help me on this issue? |
@miloradkrstevski assuming your language of choice is python you need a python driver for mysql as superset uses SQLAlchemy to process SQL related queries in the back-end. Do you have that python driver installed?? |
@TianyangLi Yes, I will take for example Windows. I installed MySQL with all add-ons (https://dev.mysql.com/downloads/windows/installer/8.0.html), Python 2.7.15 x86 (https://www.python.org/downloads/release/python-2715/), Microsoft Visual C++ Compiler for Python 2.7 (https://www.microsoft.com/en-us/download/details.aspx?id=44266) and https://www.microsoft.com/en-us/download/details.aspx?id=48145). With these installations, I still get an error either on mysql+mysqldb or mysql+mysqlconnector. What should I do next? Thanks. |
The error itself is a very straight forward fix. On ubuntu its as straight forward as: If you have a alternative linux set-up that might just do it. |
@TianyangLi Thanks a lot. I will reset Ubuntu installation and go with sudo apt-get install python-mysqldb and python 2.7. If this does not go well, I will try with python 3.xx. Hopefully, something will work. Thanks again. |
@TianyangLi Does not work. Here is the info (from Windows): (in Ubuntu will try next)
Something else comes to mind for a solution? |
@miloradkrstevski if you had read the documentation you'll have see that 1) windows is not supported, 2) the docs suggests another driver for mysql |
@xrmx Dude, I read the docs. And somehow it was working in Windows with some previous version of Superset and conn with MySQL. The thing is that I did not write it down what I have installed to work, but I know it was searching for solution pretty well, like now. Now, I will test as @TianyangLi suggests and will find out. BTW, @xrmx, do you have any possible solution in mind? Thanks. |
@TianyangLi I have tried with sudo apt-get install python-mysqldb, but still no success in Ubuntu either (@xrmx). It gives me error:
And in the terminal it is the following info:
I am using Superset==0.24, because 0.25 (or latest) gives me problem with flask. Anyone any idea? Thanks. |
|
@mistercrunch When I try to install
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-WdyxRX/mysqlclient/ What does this mean? Can anyone please explain me? I am novice in this and using only Superset. Thank you. @mistercrunch Can you reopen my issue please so I can find solution? I really need it. |
Please research how to install |
Can anyone please point me out where I miss something because certainly there is something:
[2018-05-17 11:01:23 +0000] [16859] [INFO] Starting gunicorn 19.7.1
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-q2Ff6M/mysqlclient/ 10.a. I googled it: "Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-q2Ff6M/mysqlclient/" and did the following:
After I close the terminal. Can someone please point me out some solution or additional step to take into account because I tried everything and it does not work? Thank you. |
@mistercrunch Can you please reopen the issue so someone could help me? Anyone any solution: @xrmx , @TianyangLi , @mistercrunch , ... |
Are you sure you're in the right virtual venv? have you deployed your venv in a python3 environment? its unclear from your steps.. python defaults 2.7. So its possible that you've installed python3-mysqldev library, but when you type 'pip install mysql' you're actually calling the wrong python version. Or your superset is in a python2.7 venv and you're mysqldb is in a python3 one.. |
Thank you very much @TianyangLi. That was the problem. I install all in python3, pip3, and venv is correct now. The connection to MySQL is established. |
My superset version info is :"version": "0.25.6" mysql version is : 5.7, python version info : python2.7 While I tried to use mysql as a meta data storage for superset after running Then everything worked perfectly for me. |
Hi @sohelsarder. I'm sitting with the same error. I installed Superset via docker (as per the installation documantation). I get the "Unexpected error No module named 'MySQLdb'" problem when I try to connect a MySQL database. Can you offer any advice here? Thanks |
I just tried the install again, this time going through all the steps manually and not making use of docker. This solved the problem. I think the issue with docker was that the mysqlclient installation wasn't in the correct virtual environment, however I do not know docker well enough to understand how this works exactly. |
Folks, proper solution for Ubuntu: cd /var/lib/superset
source venv/bin/activate
pip install mysqlclient Done. Explanation: superset runs in virtual environment and globally (system-wide) installed modules are not reachable from venv. Hence you'd need to dive into venv and install the module there. |
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
0.24
Expected results
Connection to db in MySQL and another db in PostgreSQL
Actual results
Can not connect either to MySQL or PostgreSQL db. The error on MySQL is: ERROR: {"error": "Connection failed!\n\nThe error message returned was:\nNo module named MySQLdb"}.
Can you please point me out:
Steps to reproduce
//
The text was updated successfully, but these errors were encountered: