5

我在 sqlite 中有一个数据库,并按照本教程 了解如何创建它。我检查了,数据库存在并包含值。

我在超集的 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)
4

1 回答 1

3

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

于 2017-11-14T17:55:26.240 回答