在docker容器中部署mariadb
yum install docker
systemctl start docker
docker pull mariadb (安装比较漫长 一般需要设置国内镜像源)
docker images
[root@192 ~]# docker run --privileged -d --restart=always -e TIMEZONE=Asis/Shanghai -e MYSQL_ROOT_PASSWORD=root -e SERVER_ID=1 -v /opt/data/mariadb/dbdata:/var/lib/mysql -p 3306:3306 mariadb --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
114c3bdec8487d24bc9f4c509411112809a56b87d343db776ba2a84bd6a2860d
[root@192 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
114c3bdec848 mariadb "docker-entrypoint..." 10 seconds ago Up 9 seconds 0.0.0.0:3306->3306/tcp upbeat_wozniak
docker exec -it 容器ID号 bash
参考文献
posted on 2019-06-09 00:20 Indian_Mysore 阅读(1287) 评论(0) 编辑 收藏 举报