I thought the driver was not loaded before, so I added it
Class.forName("com.mysql.cj.jdbc.Driver");
After discovering the error, I read the error code again: no suitable driver found for localhost: 3306/upload_file
It turned out that the URL was misspelled and not prefixed: jdbc:mysql://
Attach the complete URL, and remember to add the suffix parameter
jdbc:mysql://localhost:3306/upload_file?&useSSL=false&serverTimezone=UTC
Similar Posts:
- [Solved] Springboot Project Connect MYSQL Error: Establishing SSL connection without server’s identity verification is not recommended.
- For the problem of establishing SSL connection in mysql, set usessl = false to explicitly disable SSL, or set usessl = true
- Solutions to database connection problems: “connections could not be acquired from the underlying database!”
- [Solved] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.6…
- Logstash output jdbc Error: java.lang.IllegalAccessError: tried to access class com.mysql.jdbc.EscapeProcessor from class com.mysql.jdbc.ConnectionImpl
- [Solved] Spring Error: java.sql.SQLException: Access denied for user ‘${user}’@’localhost’ (using password: YES)
- [Solved] Sqoop error: Could not load db driver class: com.mysql.jdbc.Driver
- SSM Project Error: java.sql.SQLException: Access denied for user ‘????…§’@’localhost’ (…
- The jdbc driver imported from idea into MySQL appears “Java. Lang. classnotfoundexception: com. Mysql. CJ. JDBC. Driver”
- [Solved] Mybatis-config Error: Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: failed to parse the connection string near ‘;useUnicode=true&