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,如图:
     
     
  • 相关阅读:
    0x55 环形与后效性问题
    0x54 树形DP
    0x53 区间DP
    0x52 背包
    0x51 线性DP
    poj1015 Jury Compromise
    973、863计划取消 国家重点研发计划启动
    中科院院士陈仙辉回母校:英雄不问出处 成功要靠努力和实力来实现
    Resume (Curriculum Vitae)
    阅读linux内核代码的工具-- Source Insight
  • 原文地址:https://www.cnblogs.com/yinze/p/13894069.html
Copyright © 2011-2022 走看看