2)创建容器:root根用户的密码MYSQL_ROOT_PASSWORD采用的是root >: docker container run -itd -p3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:5.7
注:本地测试 >: mysql -hIP -P端口 -uroot -p密码
>: mysql -h 39.99.192.127 -P 3306 -u root -p >: root >: create database luffy default charset=utf8; >: grant all privileges on luffy.* to ‘luffy‘@‘%‘ identified by ‘Luffy123?‘; >: grant all privileges on luffy.* to ‘luffy‘@‘localhost‘ identified by ‘Luffy123?‘; >: flush privileges; """
Docker安装Redis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
""" 1)安装 >: docker pull redis:4.0.9
2)创建容器 >: docker container run -itd -p6379:6379 redis:4.0.9