Skip to content

Commit 35b0f26

Browse files
committed
2018-03-01 补充 docker 安装 mysql
1 parent 3017e4c commit 35b0f26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Mysql-Install-And-Settings.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33

44
## Docker 安装 MySQL
55

6+
- 关掉:SELinux
67
- 创建本地数据存储 + 配置文件目录:`mkdir -p /data/docker/mysql/datadir /data/docker/mysql/conf`
78
- 赋权(避免挂载的时候,一些程序需要容器中的用户的特定权限使用):`chmod -R 777 /data/docker/mysql/datadir /data/docker/mysql/conf`
89
- `docker run -p 3306:3306 --name mycat-mysql5.7-1 -v /data/docker/mysql/datadir:/var/lib/mysql -v /data/docker/mysql/conf:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=adg123456 -d mysql:5.7`
10+
- 连上容器:`docker exec -it 09747cd7d0bd /bin/bash`
11+
- 关于容器的 MySQL 配置,官网是这样说的:<https://hub.docker.com/_/mysql/>
12+
13+
>> The MySQL startup configuration is specified in the file /etc/mysql/my.cnf, and that file in turn includes any files found in the /etc/mysql/conf.d directory that end with .cnf.Settings in files in this directory will augment and/or override settings in /etc/mysql/my.cnf. If you want to use a customized MySQL configuration,you can create your alternative configuration file in a directory on the host machine and then mount that directory location as /etc/mysql/conf.d inside the mysql container.
14+
915

1016
## MySQL 安装
1117

0 commit comments

Comments
 (0)