如果您有权访问mysql,可以更新wp-options
桌子
修改前。。。
$ mysql -u <db_user> --password=<db_pwd> -D <db_name> <<<"select * from wp_options where option_name in (\'siteurl\', \'home\');"
+-----------+-----------------+---------------------------------------------------------------------------------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-----------------+---------------------------------------------------------------------------------------------------+----------+
| 1 | siteurl | http://172.17.0.2/wordpress | yes |
| 2 | home | http://172.17.0.2/wordpress | yes |
+-----------+-----------------+---------------------------------------------------------------------------------------------------+----------+
然后我用这个把ip改成172.17.0.4。。。
$ mysql mysql -u <db_user> --password=<db_pwd> -D <db_name> <<<"update wp_options set option_value=\'http://172.17.0.4/wordpress\' where option_name in (\'siteurl\', \'home\');"
所以这个表变成了。。。
+-----------+-----------------+---------------------------------------------------------------------------------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-----------------+---------------------------------------------------------------------------------------------------+----------+
| 1 | siteurl | http://172.17.0.4/wordpress | yes |
| 2 | home | http://172.17.0.4/wordpress | yes |
+-----------+-----------------+---------------------------------------------------------------------------------------------------+----------+
在某些情况下,自动更新此配置可能很有用。