使用MySQL数据库配置Apache超集 [英] Configuring apache superset with mysql database

查看:197
本文介绍了使用MySQL数据库配置Apache超集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在配置apache从mysql而不是sqlite读取;以下是我的配置文件中的详细信息.我不太了解如何配置上面的文件以从数据库中读取文件,这样我就可以开始创建摘要了:我的设置已经参考了此文档. https://superset.incubator.apache.org/installation.html

I am configuring apache to read from mysql instead of sqlite; The following is the details in my configuration file. I don't quite understand how to configure the file above to read from my database so that i can begin creating summaries: I have referred to this documentation for my set up. https://superset.incubator.apache.org/installation.html

# Superset specific config
#---------------------------------------------------------
ROW_LIMIT = 200000
SUPERSET_WORKERS = 4

SUPERSET_WEBSERVER_PORT = 8088
#---------------------------------------------------------

#---------------------------------------------------------
# Flask App Builder configuration
#---------------------------------------------------------
# Your App secret key
SECRET_KEY = '\2\1t567fgj7dtghjdhfui64@#$&77cvw424tkey\1\2\e\y\y\h'

# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
#SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/superset.db'
SQLALCHEMY_DATABASE_URI = 'mysql://username:password@localhost:3307/'

# Flask-WTF flag for CSRF
CSRF_ENABLED = True

# Set this API key to enable Mapbox visualizations
MAPBOX_API_KEY = ''

我运行以下命令来初始化我的项目

I run the following command to init my project

superset init

这将导致以下错误:

ERROR:flask_appbuilder.security.sqla.manager:DB Creation and initialization failed: 'NoneType' object has no attribute 'replace'

任何解决我的配置问题的方向都将受到赞赏

Any direction to fix my configuration issue will be highly appreciated

推荐答案

可能正在发生2件事:

  1. 似乎您的数据库URI应该采用 mysql://username:password @ host:port/dbname 的格式,而不是仅 mysql://username:password @ host:端口/(请参见 https://docs.sqlalchemy.org/en/13/core/engines.html#mysql 供参考)
  2. 似乎您要连接到该mysql数据库以查询它并可视化其数据-请勿将其用作您的超集数据库后端(即,将使用数据库超集来持久保存您的超集配置).对于后者,最好只使用sqlite.
    为了连接到目标数据库以实际查询它,请参阅 https:/上的连接到目标数据库"./duperset.com/getting_started
  1. It seems your DB URI should be in the format of mysql://username:password@host:port/dbname as opposed to just mysql://username:password@host:port/ (see https://docs.sqlalchemy.org/en/13/core/engines.html#mysql for reference)
  2. It seems you're looking to connect to that mysql database in order to query it and visualize its data - NOT to use it as your superset database backend (i.e. the database superset is going to use in order to persist your superset configurations). For the latter, you might be better off to just using sqlite.
    In order to connect to your target DB to actually query it, see "Connecting To Your Target Database(s)" on https://duperset.com/getting_started

这篇关于使用MySQL数据库配置Apache超集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆