初见
Docker配置
MySQL
sudo docker pull mysql:5.7
配置文件
vi /mydata/mysql/conf/my.conf
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
skip-name-resolve
# --name指定容器名字 -v目录挂载 -p指定端口映射 -e设置mysql参数 -d后台运行
sudo docker run -p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:5.7
Redis
docker pull redis
# 在虚拟机中
mkdir -p /mydata/redis/conf
touch /mydata/redis/conf/redis.con
持久化
vim /mydata/redis/conf/redis.conf
# 插入下面内容
tcp-keepalive 10
appendonly yes
requirepass root
timeout 30
docker run -p 6379:6379 --name redis \
-v /mydata/redis/data:/data \
-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \
-d redis redis-server /etc/redis/redis.conf
# 直接进去redis客户端
docker exec -it redis redis-cli
其他配置
Maven
D:\Environment\apache-maven-3.6.1\conf\settings.xml
Idea
lombok、MyBatisX
VSCode
初始化工程
web/springweb
springcloudrouting/openfeign