diff --git a/document/reference/docker.md b/document/reference/docker.md index b06bbef..08173c8 100644 --- a/document/reference/docker.md +++ b/document/reference/docker.md @@ -34,6 +34,8 @@ docker start $ContainerId docker logs $ContainerIdName(或者$ContainerId) ### 查看容器的IP地址(172.17.0.*) docker inspect --format '{{ .NetworkSettings.IPAddress }}' $ContainerId +### 同步宿主机时间到容器 +docker cp /etc/localtime $ContainerName:/etc/ ## Docker Registry ### Docker Registry 2.0搭建 diff --git a/document/reference/mysql.md b/document/reference/mysql.md index 147b775..ccb076a 100644 --- a/document/reference/mysql.md +++ b/document/reference/mysql.md @@ -62,6 +62,11 @@ delete from emp where ename='zhangsan' - 查看字符集:show variables like 'character%' - 创建数据库时指定字符集:create database mall character set utf8 +### 修改时区 +- 修改mysql全局时区为北京时间,即我们所在的东8区:set global time_zone = '+8:00'; +- 修改当前会话时区:set time_zone = '+8:00' +- 立即生效:flush privileges + ### 权限相关 - 授予所有数据库的所有权限:grant all privileges on *.* to z1@localhost identified by '123' - 授予所有数据库的所有权限(包括grant):grant all privileges on *.* to z1@localhost with grant option diff --git a/mall-admin/src/main/resources/application-prod.properties b/mall-admin/src/main/resources/application-prod.properties index b23e9cb..e392f52 100644 --- a/mall-admin/src/main/resources/application-prod.properties +++ b/mall-admin/src/main/resources/application-prod.properties @@ -1,9 +1,12 @@ #===datasource start=== -spring.datasource.url=jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8 +spring.datasource.url=jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai spring.datasource.username=reader spring.datasource.password=123456 #===datasource end=== +#\u914D\u7F6E\u65E5\u5FD7\u751F\u6210\u8DEF\u5F84 +logging.path=/var/logs + #===druid start=== #\u8FDE\u63A5\u6C60\u521D\u59CB\u5316\u5927\u5C0F spring.datasource.druid.initial-size=5