mkdir -p ~/data/podman/mysql-8.0/etc
mkdir -p ~/data/podman/mysql-8.0/var
podman run --detach \
--restart always \
--publish 23306 :3306 \
--name mysql-8.0 \
--volume /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime \
--env MYSQL_ROOT_PASSWORD = Gah6kuP7ohfio4 \
mysql:8.0.36
podman cp mysql-8.0:/etc/mysql/conf.d ~/data/podman/mysql-8.0/etc/conf.d
podman cp mysql-8.0:/var/lib/mysql ~data/podman/mysql-8.0/var
podman stop mysql-8.0
podman rm mysql-8.0
podman run --detach \
--restart always \
--publish 23306 :3306 \
--name mysql-8.0 \
--volume ~/data/podman/mysql-8.0/var:/var/lib/mysql \
--volume ~/data/podman/mysql-8.0/etc/conf.d:/etc/mysql/conf.d \
--volume /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime \
--env MYSQL_ROOT_PASSWORD = Gah6kuP7ohfio4 \
mysql:8.0.36
lwk@qwfys:~$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1647d61060aa mysql:8.0.36 "docker-entrypoint.s…" 31 minutes ago Up 31 minutes 33060 /tcp, 0.0 .0.0:23306-> 3306 /tcp, :::23306-> 3306 /tcp mysql-8.0
lwk@qwfys:~$
spring :
datasource :
hikari :
jdbc-url : jdbc: mysql: //127.0.01: 23306/mysql? useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
username : root
password : Gah6kuP7ohfio4
podman stop mysql-8.0
podman rm mysql-8.0