解决docker部署mysql 外部能访问,但是内部不能访问的问题:
grant all on 数据库.* to ‘用户名’@‘%’ identified by ‘密码’ with grant option;
mysql启动命令:
docker run -d -p 3306:3306 -v /opt/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root密码 --name 容器名 mysql:5.7.27
redis启动命令:
docker run -p 6379:6379 --name redis -v /opt/conf/redis.conf:/etc/redis/redis.conf -v /opt/redis/data:/var/lib/redis -v /opt/redis/log:/data/redis --restart always -d redis:5.0.5
rabbitmq启动命令:
docker run -d -p 5672:5672 -p 15672:15672 -v /opt/rabbitmq/data:/var/lib/rabbitmq/mnesia --privileged=true -v /opt/rabbitmq/log:/var/log/rabbitmq --privileged=true --restart always --name rabbitmq rabbitmq:management