docker 启动MySQL,redis,tomcat
mysql:
docker pull mysql:5.6 docker run -p 3306:3306 --name mysql -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6
docker cp containedID:/etc/mysql/my.cnf $PWD
show variables like
'%char%'
;
my.cnf添加以下内容测试是否启作用
[mysqld] character-set-server=utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8
docker restart containedID
show variables like
'%char%'
;
redis:
docker pull redis:3.2 docker run -p 6379:6379 --name myredis -v $PWD/data:/data -v $PWD/conf/redis.conf:/usr/local/etc/redis/redis.conf -d redis:3.2 redis-server /usr/local/etc/redis/redis.conf --appendonly yes