Skip to main content
 首页 » 编程设计

python之Superset 无法连接到我的 Sqlite 数据库

2024年10月01日6Renyi-Fan

我在 sqlite 中有一个数据库并关注 this tutorial关于如何创建它。我检查过,数据库存在并包含值。

我在超集的 Web 界面中输入了以下 SQLAlchemy URI:sqlite:///Users/me/Documents/cancellation/item/eventlog.db

出现以下错误:

ERROR: {"error": "Connection failed!\n\nThe error message returned 
was:\n'NoneType' object has no attribute 
'get_password_masked_url_from_uri'"} 

我不明白为什么要有密码,如果在文档中没有指定密码:

http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#sqlite

代码:

sqlite_file = 'eventlog.db' # the DB file 
conn = sqlite3.connect(sqlite_file)  
eventlog.to_sql('eventlog', conn, if_exists='replace', index=False) 
from sqlalchemy import create_engine 
>engine = create_engine('sqlite:////Users/me/Documents/cancellation/item/eventlog.db) 

请您参考如下方法:

最近几天这个问题让我抓狂。我最终发现您实际上必须保存数据库配置,然后返回“测试连接”页面才能真正成功。在点击保存之前尝试使用“测试连接”按钮会产生您列出的错误消息。