docker wordpress数据迁移
一、mysql迁移
1、新机器安装MySQL
[root@123 ~]# docker pull mysql:5.6
2、新机器启动MySQL
[root@123 ~]# docker run -d –name wordpress-mysql -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 mysql:5.6
3、启动mysql
docker start wordpress-mysql
备注:
– docker run :启动容器
-d:后台运行容器
–name wordpress-mysql:指定容器的名字,本文设置为wordpress-mysql
-e MYSQL_ROOT_PASSWORD=123456:指定容器的环境参数,此处初始化MySQL的root密码
-p 3306:3306:端口映射,这里将容器内的3306端口映射到docker宿主机的3306端口
mysql:镜像的名字,首先从docker宿主机本地加载,其次从dockerHub上加载
-tag:版本号
查看MySQL日志:
docker logs wordp
原文链接:https://blog.csdn.net/yeyiboy/article/details/108752796?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522168994567316800211558691%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=168994567316800211558691&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-24-108752796-null-null.268%5Ev1%5Ekoosearch&utm_term=docker%E3%80%81wordpress%E3%80%81wordpress%E5%BB%BA%E7%AB%99%E3%80%81wordpress%E4%B8%BB%E9%A2%98%E3%80%81%E5%AE%B9%E5%99%A8%E9%95%9C%E5%83%8F%E3%80%81