WordPress 서버 이전

Tested : 2015.02.09

Check DB user name

vi /home/www/jongkwang.com/wp-config.php

DB : 새로운 DB에 계정 생성

./mysql -u root -p
CREATE database jongkwangcom CHARACTER SET utf8 COLLATE utf8_bin;

// User 생성하고 패스워드 주고 권한까지 한방에 주도록 하자.
GRANT ALL PRIVILEGES ON jongkwangcom.* TO jongkwangcom@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

// 혹시 local 에서 접근이 안되면 실행
GRANT ALL PRIVILEGES ON jongkwangcom.* TO jongkwangcom@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH PRIVILEGES; //반영을 위해

DB backup & restore

  • Backup : mysqldump -ujongkwangcom -p jongkwangcom > jongkwangcom.sql
  • Restore : mysql -ujongkwangcom -p --default-character-set=utf8 jongkwangcom < jongkwangcom.sql

File Copy

tar cvf jongkwangcom.tar jongkwang.com
tar xvf jongkwangcom.tar

wp-config.php 수정

vi wp-config.php

&#039;a&#039;