# 迁移wordpress

2016.08.25

备份恢复wordpress工程文件

tar zcvf  web.tgz  /home/wwwroot/
1

备份mysql数据

mysqldump -u root -p db_name > test_db.sql
1

恢复wordpress工程文件

tar zxvf web.tgz  -C /home/wwwroot/
1

恢复mysql数据库

mysql -u root -p
use mysql;
create database db_name;
CREATE USER 'db_name'@'localhost' IDENTIFIED BY '************';
GRANT all privileges ON db_name.* TO 'db_name'@'localhost';
FLUSH PRIVILEGES;
use db_name;
source test_db.sql;
1
2
3
4
5
6
7
8