docker mysql迁移

Last updated on November 22, 2024 pm

🧙 Questions

迁移docker中的mysql镜像 【未实践】

☄️ Ideas

查看映射路径

docker inspect isxcode-mysql | more
"HostConfig": {
    "Binds": [
        "/data/mysql/data:/var/lib/mysql",
        "/data/mysql/conf.d:/etc/mysql/conf.d"
    ]
}

打包镜像

docker ps -a | grep mysql
docker commit fc65e2f1dd6e mysql:8.0-new

迁移数据

启动镜像

和原命令保持一致

docker run \
  --name isxcode-mysql-new \
  --privileged=true \
  --restart=always \
  -d \
  -p 30102:3306 \
  --add-host cdh-master:192.168.16.100 \
  --add-host isxcode-cdh1:192.168.17.91 \
  -v /data/mysql/data:/var/lib/mysql \
  -v /data/mysql/conf.d:/etc/mysql/conf.d \
  -e MYSQL_ROOT_PASSWORD=admin123 \
  mysql:8.0-new

docker mysql迁移
https://ispong.isxcode.com/kubernetes/docker/docker mysql迁移/
Author
ispong
Posted on
November 6, 2024
Licensed under