解决WordPress设置错误的url网站不能访问
由于设置了未备案的域名,而导致网站访问不了了。同时WordPress是使用docker搭建部署的
docker ps #查看 docker 容器
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f1444eca2555 wordpress "docker-entrypoint..." 29 hours ago Up 29 hours 0.0.0.0:80->80/tcp mwp cf740032d768 mysql:5.7 "docker-entrypoint..." 29 hours ago Up 29 hours 3306/tcp, 33060/tcp, 0.0.0.0:33307->3307/tcp myMysql
进入MySQL容器
docker exec -it cf740032d768 bash
mysql -u root -p
#切换数据库
use wordpress;
#更新站点url UPDATE wp_options SET option_value=replace(option_value,'未备案的域名http://www.soft210.top','http://你的ip') WHERE option_name='home' OR option_name='siteurl';
commit;