wordpress通过数据库修改访问路径

查找

  • 进入wordpress数据库
1
2
$ mysql -u [username] -p
...[password]
  • 切换数据库
1
mysql> use wordpress;
  • 查找字段
1
mysql> Select * from wp_options where option_name IN('siteurl','home');
  • 显示结果
1
2
3
4
5
6
+-----------+-------------+-----------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+-----------------------+----------+
| 2 | home | http://localhost:9999 | yes |
| 1 | siteurl | http://localhost:9999 | yes |
+-----------+-------------+-----------------------+----------+

操作

  • 修改字段
1
2
3
mysql> update wp_options set option_value='[url]' where option_name = 'siteurl';

mysql> update wp_options set option_value='[url]' where option_name = 'home';