简体   繁体   中英

Problems working with a Wordpress site on a local server

I'm trying to download a large Wordpress site and work on it locally. I exported/imported the SQL successfully using PHPMyAdmin w/ XAMPP, and changed the wp-config.php file to match my MySQL login information and I'm no longer getting "Error establishing a database connection". As far as I know, the schemas and imported information should all be good to go, but I am getting a 404 Error on the main page. Is there anywhere else I might need to update the database settings?

Any help would be much appreciated.

you will need to update your DB like so :

Update new location >

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

Fix URLs and Post slugs >

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

Then fix internal links >

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

In your case http://www.new-domain.com would be http://localhost or http://localhost/your_wp_install_folder/

After running this , just to make sure , go to your DB and check the options table for the siteurl and home options, and see that they really do point to the right place ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM