mysql 安装

摘要:
问题:连接mysql运行报错Theservertimezonevalue'ú±ê×±'isunrecognizedorrepresentsmorethanonetimezone原因:system为sql默认美国时间,而我们中国要比他们早8小时方法: 使用root用户登录mysqlshowvariableslike'%time_zone%';因此,采用+8:00格式   setglobaltime_zone='+8:00';1.版本高mysql-connector-java6所以application.properties中需要指定时区serverTimezone:在设定时区的时候,如果设定serverTimezone=UTC,会比中国时间早8个小时,如果在中国,可以选择Asia/Shanghai或者Asia/Hongkongspring.jpa.show-sql=truespring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver//mysql-connector-java6及以上要加上.cjspring.datasource.url=jdbc:mysql://localhost:3306/teacherdata?

安装参考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 unrecognizedorrepresents more than one time zone

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

方法: 使用 root 用户登录 mysql

          show variables like '%time_zone%';

mysql 安装第1张

因此,采用+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>

免责声明:文章转载自《mysql 安装》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇大话项目管理工具之Confluence篇Linux基础--------监控系统、进程管理、软件包管理-------free、dd、kill、 rpm、yum、源码安装python下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

保存linux下当前目录下所有文件的相对路径

方法一: 在系统可以上网的条件下: 1、安装工具:tree; 2、在终端输入 tree -f -i > file_list_path   file_list_path 文件内容即为当前目录下所有文件的相对路径 方法二: 在系统无法上网的情况下: 1、编写python脚本 import os root = os.getcwd() def file_...

解决confluence的乱码问题

使用confluence时发现一些含有中文的页面中,中文都变成了问号。 继续搜索解决方案,发现时数据库中数据的格式不对, 在mysql中输入以下命令:   mysql> show variables like 'char%';+--------------------------+----------------| Variable_name    ...

安装mysql

MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下公司。MySQL 最流行的关系型数据库管理系统,在 WEB 应用方面MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件之一。 一、Window版本 1、下载 1 MyS...

Mysql数据优化--DBA梳理珍藏篇

1. 优化SQL1)     通过show status了解各种sql的执行频率         show status like 'Com_%'        了解 Com_select,Com_insert 的执行次数 2)    通过Explain分析低效的sql语句 3)    建立合适的索引 4)    通过show status like '...

SQL语法

1、什么是 SQL? SQL 指结构化查询语言 SQL 使我们有能力访问数据库 SQL 是一种 ANSI 的标准计算机语言 编者注:ANSI,美国国家标准化组织 2、RDBMS RDBMS 指的是关系型数据库管理系统。 RDBMS 是 SQL 的基础,同样也是所有现代数据库系统的基础,比如 MS SQL Server, IBM DB2, Oracle,...

Centos7 安装 MySQL5.7

Centos7 安装 MySQL5.7 一、环境介绍 1.安装包版本介绍 MySQL 有三种安装方式:RPM安装、二进制包安装、源码包安装。我们这篇文章以二进制方式安装MySQL 软件名称 版本 系统版本 CentOS Linux release 7.2.1511 (Core) MySQL mysql-5.7.18-linux-glibc2....