/images/avatar.jpeg

使用docker-compose安装mariadb

step1: 创建目录 1 2 mkdir -p /server/mariadb/{config,data,log} chmod -R 777 /server/mariadb step2: 编写docker-compose.yml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 version:'3.1'services:mariadb:image:mariadb:10.5.5container_name:"mariadb1"restart:alwaysenvironment:MYSQL_USER:"root"MYSQL_PASSWORD:"123456"MYSQL_ROOT_PASSWORD:"123456"TZ:"Asia/Shanghai"ports:- "3306:3306"volumes:- ./data:/var/lib/mysql- ./log:/var/log/mysql- ./conf/my.cnf:/etc/mysql/my.cnf step3: 拷贝/etc/mysql