mysql 安装

安装参考https://www.cnblogs.com/ayyl/p/5978418.html

mysql 百度网盘下载地址  包括版本 5.7.258.0.14 )

 链接:https://pan.baidu.com/s/1zbNZ1p-H6_QuTwVXCnmz4A

提取码:4efi

 

mysql 安装时出现:one more product requirements have not been satisified 解决办法

原因是有可能是 mysql 依赖环境没有安装好

第一,点击 no

第二,点击 execute ,正常会弹出安装插件的窗口,安装即可,然后

第三,继续 next 安装就行了

 

问题:mysql5.7.1.16 出现 [Err] 1146 - Table 'performance_schema.session_status' doesn't exist

原因:是 mysql 版本问题,需要更新一下

方法:

  1.打开 cmd,进入 mysql 的安装目录下的bin目录下。

  2. 执行 mysql_upgrade -u root -p --force 命令然后输入 password,问题解决。

 

问题:连接 mysql 运行报错 The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone

原因:systemsql 默认美国时间,而我们中国要比他们早 8 小时

方法: 使用 root 用户登录 mysql

 

          show variables like '%time_zone%';

 

    

             因此,采用 +8:00 格式   

        set global time_zone='+8:00';

 

1.版本高  mysql-connector-java 6  所以 application.properties   中需要指定时区serverTimezone:

   在设定时区的时候,如果设定 serverTimezone=UTC,会比中国时间早8个小时,如果在中国,可以选择 Asia/Shanghai 或者 Asia/Hongkong

spring.jpa.show-sql=true

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver    // mysql-connector-java 6 及以上 要加上  .cj
spring.datasource.url=jdbc:mysql://localhost:3306/teacherdata?serverTimezone=Shanghai&useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root

mybatis.typeAliasesPackage=com.jlau.domain
mybatis.mapperLocations=classpath:mapper/*.xml

pom.xml

<dependency>
   <groupId>mysql</groupId>
   <artifactId>mysql-connector-java</artifactId>
   <scope>runtime</scope>
</dependency>
2.版本低     mysql-connector-java 5
spring.jpa.show-sql=true

spring.datasource.driver-class-name=com.mysql.jdbc.Driver      // mysql-connector-java 5   不需要  .cj
spring.datasource.url=jdbc:mysql://localhost:3306/teacherdata?useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root

mybatis.typeAliasesPackage=com.jlau.domain
mybatis.mapperLocations=classpath:mapper/*.xml

pom.xml 中写上版本号

<dependency>
   <groupId>mysql</groupId>
   <artifactId>mysql-connector-java</artifactId>
   <version>5.1.34</version>
   <scope>runtime</scope>
</dependency>

 

 

 

转载于:https://www.cnblogs.com/gemeiyi/p/10218241.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值