miloradkrstevski commented on issue #5013: Connecting MySQL and PostgreSQL into 
SQLAlchemy URI 
URL: 
https://github.com/apache/incubator-superset/issues/5013#issuecomment-389802987
 
 
   Can anyone please point me out where I miss something because certainly 
there is something:
   
   1. I used VMWare 12.1.1 to install Ubuntu 18.04 LTS. After installation I 
updated with the Software Updater.
   2. Next, I am following the instructions on 
[https://superset.apache.org/installation.html](url) as follows:
   2.a. In terminal, I used: `sudo apt-get install build-essential libssl-dev 
libffi-dev python-dev python-pip libsasl2-dev libldap2-dev`. The installation 
went OK with no errors.
   2.b. In terminal, as regular admin user (no root, sudo su, sudo -s, sudo 
-i), I installed: `pip install virtualenv`. The installation went OK with no 
errors.
   2.c. In terminal, I used: `sudo apt install virtualenv`. The installation 
went OK with no errors.
   2.d. In terminal, I sued: `virtualenv venv` as regular admin user (no root, 
sudo su, sudo -s, sudo -i). The installation went OK with no errors.
   2.e. After, in terminal, I used `. ./venv/bin/activate` as regular admin 
user (no root, sudo su, sudo -s, sudo -i).
   2.f. In terminal, as regular admin user (no root, sudo su, sudo -s, sudo -i) 
and also in (venv), I used: `pip install --upgrade setuptools pip`, but the 
requirements are already up-to-date.
   3. Afterwards, I started to install Superset. In teminal (venv), as regular 
admin user (no root, sudo su, sudo -s, sudo -i), I used: `pip install 
superset==0.24`. The installation went OK with no errors.
   3.a. In terminal (venv), as regular admin user (no root, sudo su, sudo -s, 
sudo -i), I used: `fabmanager create-admin --app superset` and created default 
admin user with password. The config went OK: > Recognized Database 
Authentications. Admin User admin created.
   3.b. Also as previous point 3.a. in terminal (venv) as this user, I config 
the following: `superset db upgrade` and it went OK.
   3.c. Afterwards, as previous point 3.b. in terminal (venv) as this user, I 
config the following: `superset load_examples` and this also went OK.
   3.d. The same as point 3.c. goes for config; `superset init` which also went 
OK.
   4. Now, I started Superset, in terminal (venv) as regular admin user (no 
root, sudo su, sudo -s, sudo -i): `superset runserver ` and it went OK, as 
follows below:
   >(venv) miki@ubuntu:~$ superset runserver
   Starting server with command: 
   gunicorn -w 2 --timeout 60 -b  0.0.0.0:8088 --limit-request-line 0 
--limit-request-field_size 0 superset:app
   
   [2018-05-17 11:01:23 +0000] [16859] [INFO] Starting gunicorn 19.7.1
   [2018-05-17 11:01:23 +0000] [16859] [INFO] Listening at: http://0.0.0.0:8088 
(16859)
   [2018-05-17 11:01:23 +0000] [16859] [INFO] Using worker: sync
   [2018-05-17 11:01:23 +0000] [16863] [INFO] Booting worker with pid: 16863
   [2018-05-17 11:01:23 +0000] [16864] [INFO] Booting worker with pid: 16864
   
   5. Went to Firefox 60.0 on address [http://localhost:8088/login/](url) and 
logged in with admin user. Everything is OK.
   6. Tested with Upload CSV into sqlite default Superset db and the CSV was 
imported in sqlite (main) as follows: `CSV file "2017.csv" uploaded to table 
"2017" in database "main"` with SQLAlchemy URI: 
`sqlite:////home/miki/.superset/superset.db.`` From this I tested with some 
charts / slices and everything is OK.
   7. Now, I logged out from Superset and stopped superset server and closed 
the terminal.
   8. Afterwards, I installed MySQL server, as follows: `sudo apt-get update` - 
OK, `sudo apt-get install mysql-server` - OK, started mysql with `sudo mysql -u 
root` and run in mysql> `ALTER USER 'root'@'localhost' IDENTIFIED WITH 
mysql_native_password BY 'miki';` - OK (Query OK, 0 rows affected (0.00 sec)) 
and on the end mysql> `\quit`.
   9. Next, I installed MySQL Workbench, as follows: `sudo apt update && sudo 
apt upgrade` - OK, `sudo apt install mysql-workbench` - OK. Started MySQL 
Workbench and created schema "miki".
   10. Now, I installed the instruction from 
[https://superset.apache.org/installation.html#database-dependencies](url) for 
MySQL, as follows: `pip install mysqlclient` in terminal as regular admin user 
(no root, sudo su, sudo -s, sudo -i), but it gave me error:
   > miki@ubuntu:~$ pip install mysqlclient
   Collecting mysqlclient
     Downloading 
https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz
 (89kB)
       100% |████████████████████████████████| 92kB 615kB/s 
       Complete output from command python setup.py egg_info:
       sh: 1: mysql_config: not found
       Traceback (most recent call last):
         File "<string>", line 1, in <module>
         File "/tmp/pip-build-q2Ff6M/mysqlclient/setup.py", line 17, in <module>
           metadata, options = get_config()
         File "setup_posix.py", line 44, in get_config
           libs = mysql_config("libs_r")
         File "setup_posix.py", line 26, in mysql_config
           raise EnvironmentError("%s not found" % (mysql_config.path,))
       EnvironmentError: mysql_config not found
       
       ----------------------------------------
   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: `pip 
install --upgrade setuptools` - OK (and rerun `pip install mysqlclient` but 
still the same error), also tried as sudo su - but the same error.
   10.b. Next, I tried `sudo apt-get install python3.6-dev libmysqlclient-dev` 
- OK and rerun `pip install mysqlclient`. Now it went OK as follows:
   > miki@ubuntu:~$ pip install mysqlclient
   Collecting mysqlclient
     Using cached 
https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz
   Building wheels for collected packages: mysqlclient
     Running setup.py bdist_wheel for mysqlclient ... done
     Stored in directory: 
/home/miki/.cache/pip/wheels/50/c7/31/81a516762c8e9324f2b1fdffc1e84b9f07224fe3707956f6e1
   Successfully built mysqlclient
   Installing collected packages: mysqlclient
   Successfully installed mysqlclient-1.3.12
   
   After I close the terminal.
   11. Finally, I got to SQLAlchemy URI (first started terminal: `sudo su`, and 
run `. ./venv/bin/activate` and after `superset runserver`). Then went on 
Superset in Firefox.
   12. In SQLAlchemy URI, I have tried the following: 
`mysql+mysqldb://root:miki@localhost/miki` and gives me error: "ERROR: 
{"error": "Connection failed!\n\nThe error message returned was:\nNo module 
named MySQLdb"}"
   12.a. Also tried: `mysql://root:miki@localhost/miki` and 
`mysql+mysqlconnector://root:miki@localhost/miki` and the same error.
   12.c Next, I tried all 3x connection details in point 12 and 12.a, but with 
port 3306 after @localhost:3306/miki, and the same error.
   
   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.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to