报错01
16-Nov-2021 17:15:56.826 严重 [Druid-ConnectionPool-Create-1874298737] com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl.error create connection SQLException, url: jdbc:mysql://localhost:3306/mybatis?serverTimezone=Asia/Shanghai, errorCode 1045, state 28000
java.sql.SQLException: Access denied for user 'a'@'localhost' (using password: YES)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:833)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:453)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838)
16-Nov-2021 17:16:29.621 信息 [http-nio-8080-exec-4] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [com.alibaba.druid.proxy.jdbc.DataSourceProxyCustomizer]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [com.alibaba.druid.proxy.jdbc.DataSourceProxyCustomizer]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.sql.SQLException: Access denied for user ‘a’@‘localhost’ (using password: YES)
原因:数据库用户名,密码 可能和window的有冲突。德鲁伊数据池会爆。 然后接着报错[http-nio-8080-exec-4]
解决办法:
改 链接数据库配置文件 *.properties 加上一些字符
1、./是当前目录
2、…/是父级目录
3、/是根目录
SqlSession 是其核心接口。在 MyBatis 中有两个实现类,DefaultSqlSession 和 SqlSessionManager。
Ctrl+shift+v:可以打开复制的历史记录
Ctrl+alt+v:快速补全返回对象和返回类型