I'm having an issue with a WordPress site that I'm running locally on my machine accessing my local database that I've created. The database I pulled down is from a live, working database, but I would like to work locally for both the db and WP site.
When I browse to the site, I'm not getting an "Error establishing connection" message, so my wp-config is setup correctly with the hostname, username, and pw. I can see the browser trying to load the page, but after a while (1-2 mins), the browser stops, but no error message is returned.
I then purposely put in wrong credentials in my wp-config, where I then the typical "Error establishing..." message.
I'm not sure how to solve this issue because I'm not even sure what the problem is. Could anyone please provide some insight into what I should look into?
Edit
PHP error logs contain the following
[UTC] PHP Warning: mysql_connect(): MySQL server has gone away in C:\xampp\htdocs\.........\web\content\wp-includes\wp-db.php on line 1147
[UTC] PHP Warning: mysql_connect(): Error while reading greeting packet. PID=3632 in C:\xampp\htdocs\...\web\content\wp-includes\wp-db.php on line 1147
[UTC] PHP Warning: mysql_connect(): MySQL server has gone away in C:\xampp\htdocs\..\web\content\wp-includes\wp-db.php on line 1147
[UTC] PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\..\web\content\wp-includes\wp-db.php on line 1147
Try overriding these settings in wp_config.php with the url of your local site
define('WP_HOME','url_to_your_site');
define('WP_SITEURL','url_to_your_site');
More info here: http://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php
Those two values are stored in the db, and WP will freak out if you don't set them.
Edit:
Based on your logs, this is just MySQL and php not talking.
Make sure that MySQL is running and look at the wp_config settings for the db connection.
Make sure you are connecting to the right port, and try connecting to 127.0.0.1 instead of localhost.
Open the admin panel and go to "settings". Choose "General" and change the url as your local site appears. Change third box url and fourth box url in given two boxes.
I'd search on here for those error messages. There seem to be other people who have hit the a similar issues (for example here). Might be worth restarting MySQL, and if all else fails, starting from scratch following the moving WordPress link I mentioned above.
Hobo's answer above answered my question.