docker常用命令记录

创建mysql容器

docker run -p 3306:3306 --name mysql -v /home/service/mysql/logs:/var/log -v \
> /home/service/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7

 

CREATE USER 'admin'@'%' IDENTIFIED BY 123456';

GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION; 

flush privileges; 

 

posted @ 2024-10-26 15:43  Venux  阅读(4)  评论(0编辑  收藏  举报