podman安装MySQL 8

VOL_HOME=/data/podman

MYSQL_EVN=mysql;

MYSQL_PORT=3306;

MYSQL_ROOT_PASSWORD='joycode';

mkdir -p $VOL_HOME/${MYSQL_EVN}/conf/conf.d;

mkdir -p $VOL_HOME/${MYSQL_EVN}/data;

podman run --name mysql-temp \

-e TZ=Asia/Shanghai \

-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \

-d \

mysql:8.3.0 \

--character-set-server=utf8mb4 \

--collation-server=utf8mb4_general_ci;

podman cp mysql-temp:/etc/my.cnf $VOL_HOME/${MYSQL_EVN}/conf/my.cnf;

podman run --name ${MYSQL_EVN} \

-e TZ=Asia/Shanghai \

-v $VOL_HOME/${MYSQL_EVN}/data:/var/lib/mysql \

-v $VOL_HOME/${MYSQL_EVN}/conf/my.cnf:/etc/my.cnf \

-v $VOL_HOME/${MYSQL_EVN}/conf/conf.d:/etc/mysql/conf.d \

-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \

-p $MYSQL_PORT:3306 \

-d \

mysql:8.3.0 \

--character-set-server=utf8mb4 \

--collation-server=utf8mb4_general_ci;

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享