0

I'm running the following command: schemacrawler.cmd -server=mysql -database=prepaid -infolevel=minimum -command=list -loglevel=CONFIG -url=jdbc:mysql://127.0.0.1:3306/prepaid -u=root -schemas=prepaid

And I'm getting the following error:

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

================= Please advise

  • You should include more information including what you are trying to accomplish and what you have tried so far. – nloewen Feb 22 '17 at 16:10

1 Answers1

2

Please make sure to use the correct MySQL database connection URL, following the documentation on Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J. In particular, you need to set nullNamePatternMatchesAll=true like this:

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

Or, better, use SchemaCrawler's built-in support for MySQL, like this, which is much easier:

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

Sualeh Fatehi, SchemaCrawler

Sualeh Fatehi
  • 4,700
  • 2
  • 24
  • 28