标签:def exe client 环境 编辑 账号 环境搭建 rom serve
docker pull mysql:5.7
mkdir -p /home/doufu/docker/mysql/config
mkdir -p /home/doufu/docker/mysql/data
vi my.cnf
[mysqld] er=mysql character-set-server=utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8
wq保存退出
docker run \ -d -p 3306:3306 \ -e MYSQL_USER="test" -e MYSQL_PASSWORD="lin@123456" \ -e MYSQL_ROOT_PASSWORD="lin@123456" \ --name mysql_5.7 \ -v /home/doufu/docker/mysql/config/my.cnf:/etc/my.cnf \ -v /home/doufu/docker/mysql/data:/var/lib/mysql 镜像ID
docker exec -it mysql_5.7 bash
mysql -uroot -p use mysql GRANT ALL PRIVILEGES ON *.* TO ‘test‘@‘%‘ WITH GRANT OPTION;
show variables like ‘%char%‘;
select user,host from user;
docker exec -it mysql bash $ mysql -uroot -p $ use mysql
标签:def exe client 环境 编辑 账号 环境搭建 rom serve
原文地址:https://www.cnblogs.com/xianyudoufu/p/14947719.html