Reputation: 1365
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.
Upvotes: 1
Views: 103
Reputation: 15949
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 ...
Upvotes: 1