mysql 오류 해결
7560 단어 idea
my batis 코드 생 성 도 구 를 사용 할 때 시간 대 오류 알림 은 다음 과 같 습 니 다.
C:\springinit\demo\src\main\java>java -jar mybatis-generator-core-1.3.7.jar -configfile generatorConfig.xml -over
write
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. Th
e driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
java.sql.SQLException: The server time zone value '???ú±ê×??±??' is unrecognized or represents more than one t
ime zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to
use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207)
at org.mybatis.generator.internal.JDBCConnectionFactory.getConnection(JDBCConnectionFactory.java:84)
at org.mybatis.generator.config.Context.getConnection(Context.java:542)
at org.mybatis.generator.config.Context.introspectTables(Context.java:446)
at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:257)
at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:189)
at org.mybatis.generator.api.ShellRunner.main(ShellRunner.java:117)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '???ú±ê×??±
??' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (v
ia the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time z
one support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2234)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2258)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:966)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
... 9 more
2.해결 방법
jdbc Connection 설정,server imezone 설정 추가
아래 와 같다
4.567913.데이터베이스 설정 표 user 가 가리 키 는'데이터베이스 이름'은 test.user,mdblog.user 가 다르다 는 것 을 나타 낸다.그렇지 않 으 면 헷 갈 릴 수 있다.4.다시 한 번
3.
C:\springinit\demo\src\main\java>java -jar mybatis-generator-core-1.3.7.jar -configfile generatorConfig.xml -overwrite
Table Configuration user matched more than one table (mdblog..user,mysql..user)
Cannot obtain primary key information from the database, generated objects may be incomplete
Cannot obtain primary key information from the database, generated objects may be incomplete
Existing file C:\springinit\demo\src\main\java\.\cn\goingtodo\domain\User.java was overwritten
Existing file C:\springinit\demo\src\main\java\.\cn\goingtodo\IDao\UserMapper.java was overwritten
MyBatis Generator finished successfully, there were warnings.
5.부록C:\springinit\demo\src\main\java>java -jar mybatis-generator-core-1.3.7.jar -configfile generatorConfig.xml -overwrite
Table Configuration mdblog.user matched more than one table (mdblog..user,mysql..user)
Cannot obtain primary key information from the database, generated objects may be incomplete
Cannot obtain primary key information from the database, generated objects may be incomplete
Existing file C:\springinit\demo\src\main\java\.\cn\goingtodo\domain\User.java was overwritten
Existing file C:\springinit\demo\src\main\java\.\cn\goingtodo\IDao\UserMapper.java was overwritten
Existing file C:\springinit\demo\src\main\java\.\cn\goingtodo\domain\User.java was overwritten
Existing file C:\springinit\demo\src\main\java\.\cn\goingtodo\domain\UserWithBLOBs.java was overwritten
Existing file C:\springinit\demo\src\main\java\.\cn\goingtodo\IDao\UserMapper.java was overwritten
MyBatis Generator finished successfully, there were warnings.
자동 생 성 이 쉽 지 않 네요.더 듬 어 봤 는데...
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Gradle + Kotlin + Thymeleaf에서 Hello World평소에는 toB의 업무 시스템을 만들고 있습니다. 사내에서의 기술의 업데이드가 없기 때문에 개인적으로 여러가지 배우려고 생각해, 처음에 Spring Boot로 간단한 프로젝트를 만들려고 했습니다만 생각보다 걸리거나 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.