Wordpress locally
- Started
- Last post
- 13 Responses
- thatboyneave
Locally I have MAMP running and it works fine with a fresh local install of WordPress.
Downloaded a copy of a WordPress site (that was installed with the 1 click installer) from my MT webhost.
Exported the wordpress database from MT and replicated it locally using phpMyAdmin and importing the downloaded .sql file.
Replaced all instances of the live URL in the database with http:/localhost:8888 (which is pointed to the local copy of the WordPress site through MAMP prefs).
Still getting the 'Error establishing a database connection' WordPress error when trying to access localhost.
What's missing?
- ernexbcn0
change localhost to http://127.0.0.1:8888
- Where do you do this? MAMP? System prefs?thatboyneave
- in the wordpress config files or wp control panel if you can access iternexbcn
- Gotchathatboyneave
- thatboyneave0
Replaced localhost in the db with 127.0.0.1 as suggested, but still having the same issue.
- ernexbcn0
the phpmyadmin of your MAMP works?
- thatboyneave0
Yes phpMyAdmin is fine.
- thatboyneave0
Is this line in wp-config correct?
/** MySQL hostname */
define('DB_HOST', 'http://127.0.0.1:8889');- try http://localhost:888… ... check in MAMP that that's the port thoernexbcn
- Changed it back to localhost:8889, and the port is correct in MAMP, but still got same problem
thatboyneave
- sneakybadger0
Did you ftp the files from server to local? Sometimes it doesn't come across cleanly. I always use a separate version that i install and set up locally!
- thatboyneave0
OK, so pretty sure wp-config has all the right info in it. MAMP is set up as it would be by default, with port 8888 for Apache and 8889 for SQL. Did a find and replace for the live domain with localhost in the sql file.
Is there anything else to look at?
- meffid0
It's going to be quick to install fresh via MAMP.
Can be difficult to setup and troubleshoot stuff like this.
- thatboyneave0
I've tried a fresh install, then exporting from the live site to local, but it seems like there ends up being differences between the two. Like:
- the custom menus don't come across
- jquery breaks (maybe using a different version or something?)So I was hoping to replicate what's on the live site as closely as possible.
- meffid0
Where are you loading jQuery from?
It wouldn't fix this error though I spose.
- Samush0
am i really gonna be the first guy to suggest you check your database connection details (username/password)??
also check that the connection isn't expecting any unusual table-prefixes- this is more likely with a clean install locally then a data import.wordpress is generally i total dick to migrate between "server" environments.
- thebottlerocket0
I see Samush beat me to it.
More than likely, you don't have the same users for the dbase on your MT site as you do locally.
- thebottlerocket0
I should be more clear. in phpMyAdmin you can set up database users, which have read and write permissions across the various mysql databases you may have.
More than likely, the username/pasword to access the word press database IS NOT the same as the one you have locally. So you either need to set up a new user or change the wordpress configuration to use the username/password of an existing user on your local system(MAMP install).
HTH
Tim