0

我正在运行以下命令: schemacrawler.cmd -server=mysql -database=prepaid -infolevel=minimum -command=list -loglevel=CONFIG -url=jdbc:mysql://127.0.0.1:3306/prepaid -u=根 -schemas=预付费

我收到以下错误:

Feb 22, 2017 5:11:48 PM us.fatehi.commandlineparser.CommandLineUtility logFullStackTrace
SEVERE: Exception retrieving table information: Table name pattern can not be NULL or empty.
schemacrawler.schemacrawler.SchemaCrawlerException: Exception retrieving table information: Table name pattern can not be NULL or empty.
        at schemacrawler.crawl.SchemaCrawler.crawlTables(SchemaCrawler.java:739)
        at schemacrawler.crawl.SchemaCrawler.crawl(SchemaCrawler.java:797)
        at schemacrawler.tools.executable.BaseStagedExecutable.execute(BaseStagedExecutable.java:91)
        at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.execute(SchemaCrawlerCommandLine.java:129)
        at schemacrawler.Main.main(Main.java:90)
Caused by: java.sql.SQLException: Table name pattern can not be NULL or empty.
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)
        at com.mysql.cj.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:3836)
        at schemacrawler.crawl.TableRetriever.retrieveTables(TableRetriever.java:114)
        at schemacrawler.crawl.SchemaCrawler.lambda$crawlTables$26(SchemaCrawler.java:570)
        at schemacrawler.crawl.SchemaCrawler$$Lambda$41/1559122513.call(Unknown Source)
        at sf.util.StopWatch.time(StopWatch.java:156)
        at schemacrawler.crawl.SchemaCrawler.crawlTables(SchemaCrawler.java:567)
        ... 4 more

=================请指教

4

1 回答 1

2

请确保使用正确的 MySQL 数据库连接 URL,遵循Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J的文档。特别是,您需要这样设置nullNamePatternMatchesAll=true

schemacrawler.cmd -server=mysql -database=prepaid -infolevel=minimum -command=list -loglevel=CONFIG -url=jdbc:mysql://127.0.0.1:3306/prepaid?nullNamePatternMatchesAll=true -u=root -schemas=prepaid

或者,更好的是,使用 SchemaCrawler 对 MySQL 的内置支持,就像这样,这更容易:

schemacrawler.cmd -server=mysql -host=127.0.0.1 -database=prepaid -infolevel=minimum -command=list -loglevel=CONFIG -u=root -schemas=prepaid

Sualeh Fatehi,SchemaCrawler

于 2017-02-23T02:42:44.733 回答