WordPress 사이트 주소 변경 실수시, database에서의 변경

WordPress를 운영한다면 개인도메인에 연결해서 사용하는 경우가 있다.

이 도메인이 변경되는 경우 wordpress 관리자 페이지 – 설정에서 siteurl과 home 정보를 변경해주어야 한다.
이 주소 변경할 때 실수로 www..iwgh.run으로 오기하는 바람에 wordpress에 접속이 되지 않는 상황이 생겼다.

기존에는 공인IP를 치고 들어가면 되었으나 어찌된 일인지 변경을 위해 관리자 페이지에 접속을 하니 오기된 “www..” 
으로 리다이렉트 되는 바람에 관리자 페이지에는 접근도 못하게 되었다.

매우 난감하여 서버에 접속하여 config 파일들을 둘러보았으나 해당 변경을 수행하는 php 파일은 있었으나
오기된 사이트 주소인 “www..iwgh.run”에 대한 정보는 없었다.

해당 정보는 다른 글이나 계정정보와 마찬가지로 database에 저장되는 것으로 짐작하여 확인해보니 wordpress database의 “wp_options” table에 저장됨을 확인하였다.

여기서 수정을 하니 정상 접속이 되었다. 어휴…

# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 15341
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| wordpress          |
+--------------------+
4 rows in set (0.01 sec)

MariaDB [(none)]> use wordpress
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [wordpress]> show tables;
+-----------------------+
| Tables_in_wordpress   |
+-----------------------+
...
| wp_options            |
| wp_postmeta           |
| wp_posts              |
...
+-----------------------+
13 rows in set (0.00 sec)

MariaDB [wordpress]> desc wp_options;
+--------------+---------------------+------+-----+---------+----------------+
| Field        | Type                | Null | Key | Default | Extra          |
+--------------+---------------------+------+-----+---------+----------------+
| option_id    | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| option_name  | varchar(191)        | NO   | UNI |         |                |
| option_value | longtext            | NO   |     | NULL    |                |
| autoload     | varchar(20)         | NO   | MUL | yes     |                |
+--------------+---------------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

MariaDB [wordpress]> select option_name from wp_options;
+---------------------------------------------------------------------------------+
| option_name                                                                     |
+---------------------------------------------------------------------------------+
...                                                                   |
| site_logo                                                                       |
| siteurl                                                                         |
| start_of_week                                                                   |
...
+---------------------------------------------------------------------------------+
211 rows in set (0.00 sec)

MariaDB [wordpress]> select option_id, option_value from wp_options where option_name = 'siteurl';
+-----------+----------------------+
| option_id | option_value         |
+-----------+----------------------+
|         1 | http://www..iwgh.run |
+-----------+----------------------+
1 row in set (0.00 sec)

MariaDB [wordpress]> update wp_options set option_value = 'http://www.iwgh.run' where option_name = 'siteurl';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [wordpress]> select option_id, option_value from wp_options where option_name = 'siteurl';
+-----------+---------------------+
| option_id | option_value        |
+-----------+---------------------+
|         1 | http://www.iwgh.run |
+-----------+---------------------+
1 row in set (0.00 sec)

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다