我的机器上运行着 mysql的无登录变体。所以我只是输入mysql
获取 mysql 客户端 shell。
不,当我试图让 SchemaSpy 连接到 mysql 时它失败了:
# try with my user:
java -jar schemaSpy_5.0.0.jar -t mysql -dp /home/bodo/bin/mysql_conn/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar -host localhost -u bodo -db ibo -o /home/bodo/bin/schemaspy/ibo
Using database properties:
[schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/mysql.properties
Thu Feb 10 17:01:05 CET 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Failed to connect to database URL [jdbc:mysql://localhost/ibo]
java.sql.SQLException: Access denied for user 'bodo'@'localhost' (using password: NO)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:864)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1707)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1217)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2189)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323)
at net.sourceforge.schemaspy.SchemaAnalyzer.getConnection(SchemaAnalyzer.java:582)
at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:157)
at net.sourceforge.schemaspy.Main.main(Main.java:42)
# try without user does not work at all
bodo@bodo-work:~/bin/schemaspy$ java -jar schemaSpy_5.0.0.jar -t mysql -dp /home/bodo/bin/mysql_conn/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar -host localhost -db ibo -o /home/bodo/bin/schemaspy/ibo
net.sourceforge.schemaspy.Config$MissingRequiredParameterException: Required parameter '-u' was not specified.
所以重点是Access denied for user 'bodo'@'localhost' (using password: NO)
我该如何调试这个或者我需要如何更改我的 MySQL 设置才能让 SchemaSpy 运行?