PDA

View Full Version : Moving Wordpress to a new host.



mikesmind
November 1st, 2009, 10:01 PM
The solution is probably staring me in the face, but for now it eludes me!

I am moving one of my blogs to a new host. For some reason, I can't get it to connect to the database. As far as I can tell, I have setup the wp-config file correctly to match the user and password in mysql.

I get the following error message:
Error establishing a database connection

Here is what I put in my wp-config file:


// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'accountname_dbname');

/** MySQL database username */
define('DB_USER', 'accountname_username');

/** MySQL database password */
define('DB_PASSWORD', 'password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');If you don't see anything wrong with those settings, here are some other questions:


When I go into phpMyAdmin, it says the user is username@localhost. I tried just using the username in wp-config, but that didn't work either. Is there a way to test the mySQL login outside of Wordpress?
Do I need to get new Authentication Unique Keys for this blog on the new host, or can I use the old ones?
Any other questions?

Thanks, Mike

LisaWood
November 1st, 2009, 10:28 PM
Have you actually filled in the values on your end? I assume this code is just to show us the code structure...

mikesmind
November 2nd, 2009, 06:59 AM
Yes, the correct values are filled in.

Thanks, Mike

Lynn Terry
November 2nd, 2009, 08:44 AM
I'm not sure who you're hosting with (new host) but I know with HostGator you can ask these types of questions with their online chat support and they can usually fix it for you in a matter of minutes. Try that and see if your host can do a quick fix so you can move forward.

Baggs
November 2nd, 2009, 11:55 AM
Try renaming the wp-config file to something else, say wp-configold and then recreating it by opening wp-configold in notepad and saving as wp-config and uploading to your server.

I have just moved a couple of blogs to a new host and had to go through this, so it might help

lindastacy
November 2nd, 2009, 02:23 PM
I may be confused by the statement, "it says the user is username@localhost," but did you actually try username@localhost as the DB user?

teckyhead
November 2nd, 2009, 06:59 PM
On the hosting account that you moved to did you remember to give the user access to the database after you created the database and user?

mikesmind
November 3rd, 2009, 08:20 AM
Linda, I only put "username" in the description to obscure the true user name.

Gary, Yes, I gave the user all access to the database.

Baggs, I'll try your trick of re-creating the wp-config file. Perhaps it is corrupt in some manner.

Lynn, It is hosted with my reseller account from Hostgator. I will try their support today as well.

Thanks, Mike

StephenT
November 3rd, 2009, 08:22 AM
I recently had my annual fee come up for a host that I like, but not as well as hostgator, which I also have. I thought about moving it over, but with everything else going on, it wasn't worth the hassle! Each time I mess with my blog, it winds up down until I get someone to fix it. That's what happens when you are non-techy!

mikesmind
November 3rd, 2009, 08:29 AM
That's what happens when you are non-techy!

It even happens when you are a techy! ;)

StephenT
November 3rd, 2009, 08:33 AM
Glad to hear it!

lindastacy
November 3rd, 2009, 02:26 PM
Linda, I only put "username" in the description to obscure the true user name.

Yeah... I know, but what I was confused by is this...

Let's say the username is popcorn.

What I understood you to say was that in your database admin is says the username is popcorn@localhost
and
you tried just popcorn.

I was asking if you tried popcorn@localhost as the username.

Hopefully by now your hosting support has helped you out.