添加数据,URI输入地址:mysql://root:123456@192.168.1.204/world,链接失败
后台报错:ImportError: No module named MySQLdb
这是因为需要安装MySQL-python,最好使用python的easy_install安装
使用离线安装的系统:停止superset
安装easy_install:
# python ez_setup.py
安装MySQL-python:# easy_install MySQL-python,报错EnvironmentError: mysql_config not found
原因缺少mysql-devel :yum -y install mysql-devel
再次安装MySQL-python:# easy_install MySQL-python
启动superset:superset runserver
-----------------------------------------------------
ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory
找到find / -name 'libmysqlclient.so.20'
做一个软连接:
ln -s /usr/local/mysql/lib/libmysqlclient.so.20 /usr/lib64/libmysqlclient.so.20
------------------------------
为防止中文乱码,URI地址一定要加?charset=utf8,如下
mysql://root:123456@192.168.1.204/world?charset=utf8