wp Error establishing a database connection
# March 28, 2013 at 7:43 am
Hi, Can anyone help?
I’m trying to move the wp site I’ve been working on to a /url from localhost.
This is what I’ve done so far:
1. exported db .sql
2. created a new db and user with all privileges in host
3. imported db .sql successfully
4. copied my wp files into the /url
5. changed the .config file with define(‘DB_NAME’, ‘database name’); define(‘DB_USER’, ‘database user’); define(‘DB_PASSWORD’, ‘password’); define(‘WP_HOME’, ‘http://www.urladdress/’);
and I still get this error. Is there something I’m missing?
Would really appreciate some help.
ps. I’ve tried both with the home/siteurl and without and still same error# March 28, 2013 at 7:57 am
just before level 3, you need to open your .sql file in the editor and rename the path – instead of the localhost path you need to put the domain, for example:
just copy and replace all.. after that save the file and continue with step 3…
* make sure when you changing that domain it’s without the last slash /# March 28, 2013 at 7:57 am
9 out of 10 times it’s just a mistake/typo in the database name, user, or password. Double triple check if all that is correct. Lord knows I keep having trouble with it all the time!
I think exporting and importing the database doesn’t have anything to do with this problem (the config file will just look if there is a database/user, not directly if it has contents or not), nor do I think the WP_HOME and WP_SITEURL have any impact (meaning whether they’re correct or not, that’s probably not why you get that error).
You must be logged in to reply to this topic.