You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用SchemaCrawler生成SQLite数据库图表时遇连接URL模板错误求助

解决SchemaCrawler连接SQLite的错误问题

错误原因及修复步骤:

  1. 修正服务器参数
    你遇到的第一个错误「No database connection URL template provided」,核心原因是SchemaCrawler对SQLite的服务器标识是sqlite,而非sqlite3。所有命令里的--server=sqlite3都需要改为--server=sqlite。

  2. 修复数据库路径问题
    切换为sqlite后出现的连接失败,是因为JDBC SQLite驱动不支持~这类用户目录缩写,必须使用完整的绝对路径:

    • 本地运行时:将~/Downloads/.../my.db替换成实际的绝对路径,比如/home/xxx/Downloads/schemacrawler/schemacrawler-16.19.9-bin/bin/my.db
    • Docker运行时:确保数据库文件在你挂载的目录下,命令里的数据库路径要使用容器内的路径(比如你挂载了当前目录到/home/lch,就用--database=/home/lch/my.db)

正确命令示例:

本地运行:

./schemacrawler.sh --server=sqlite --database=/home/yourusername/Downloads/schemacrawler/schemacrawler-16.19.9-bin/bin/my.db --outputformat=png --outputfile=out.png --command=schema --info-level=standard

Docker运行:

docker run --mount type=bind,source="$(pwd)",target=/home/lch --rm -it schemacrawler/schemacrawler /opt/schemacrawler/bin/schemacrawler.sh --server=sqlite --database=/home/lch/my.db --info-level=standard --command=schema --output-file=output.png

额外检查点:

  • 确认数据库文件确实存在于指定路径,且当前用户拥有读取权限
  • 如果仍有问题,添加--log-level=DEBUG参数,通过详细日志定位具体连接问题

内容的提问来源于stack exchange,提问作者Phenix6126

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 06:37:35