zoukankan      html  css  js  c++  java
  • 关于“Cannot resolve table 'user'”报错及运行日志报java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone的问题解决

      springboot+vue建立映射时,后端引用@Table(name=“user”) 来对应表名 user,但引用后报错“Cannot resolve table 'user'”,尝试了多篇博主的博文后,问题解决,现在总结一下各位大佬的方法:

    第一:View-->Tool windows-->Database-->Data Source-->MySQL输入Host、Port和账号密码进行测试

     

     如果报Server returns invalid timezone. Need to set 'serverTimezone' property.在URL后缀加上?serverTimezone=GMT%2B8

    测试成功后,Apply后点击OK

    第二:View-->Tool windows-->Persistence后双击“entityManagerFactory”右键选择Assign Data Sources加载刚才建的Database

     

     

     上述两步执行后还报“Cannot resolve table 'user'”的话,尝试以下操作File-->Settings-->Editor-->Code Style-->Inspections取消JPA的勾选框。

    在后端工程运行中如果报“java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time 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.”,在application.properties配置文件的spring.datasource.url的值后边加上

    ?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC,如图:
     
     
  • 相关阅读:
    使用60赫兹交流电的关西人
    UI交互细节节选控件使用细则
    PNG button (按钮) files with transparency, for Visual C++ 6.0 and VS2005
    成都第二天:美食
    精力管理与状态转换
    再议“专注”
    成都第一天:印象
    Flash AMF协议
    AS3.0 JSON介绍
    AS3.0 利用AMFPHP与PHP进行通讯 .
  • 原文地址:https://www.cnblogs.com/yinze/p/13894069.html
Copyright © 2011-2022 走看看