I have signed up with Host Gator and am in the process of moving one of my wordpress sites over from 1and1.
When I try to import the old database into the newly created database on Host Gator via phpmyadmin import function, I get the following error:
-- phpMyAdmin SQL Dump
-- version 2.6.4-pl3
-- Host: HOSTNAME
-- Generation Time: Jan 14, 2012 at 10:03 PM
-- Server version: 5.0.91
-- PHP Version: 5.3.3-7+squeeze3
-- Database: `DBNAME`
#1044 - Access denied for user 'NEWUSER'@'localhost' to database 'DBNAME'
I've read that I should just go and add the new user/pass to the old databse before exporting. I would, however 1and1 doesn't allow more than one user/pass. Then I thought I could create a user with the same credentials on the new host - but any new usernames use a different prefix, so that's not possible.
Is there any way around this?
I've read that I should just go and add the new user/pass to the old databse before exporting.
Adding a new user/pass at 1and1 doesn't make sense when you just want to make a backup. What you do need is to have a database created at Hostgator, associate a database username with it and give it all the permissions. This you can and must do via Hostgator's control panel.
What I believe you're doing wrong is creating the database backup. I think you're going in phpmyadmin, and then go directly to "export", when you need to choose the database you want to work with first. When creating the database backup, you need to follow the instructions at http://faq.1and1.co.uk/web_space__access/mysql/15.html.
When doing the import via phpmyadmin, you again need to first select/click the database you want to import the data into.
The database name, database username and password at Hostgator will most likely be different from the ones you had at 1and1 (they have the form yourcpanelaccountusername_databasename). This means you will have to edit your wordpress configuration file with the new credentials.
Thanks for the reply.
It seemed odd that one would have to add credentials for this to work but someone online mentioned it somewhere (so it must be true
I actually had done all you suggested. I had created a database at HG, created a user, gave it full permissions. I went to 1and1, used phpmyadmin to export the database. Only difference is, I think I followed Host Gator's instructions. And, last but not least I had changed the wp config stuff as well.
In the end, I contacted HG's support and found out the exported database had a few lines that were causing it to try and create a database from scratch. Once those lines were removed, it imported successfully.
Some things can be so simple...
First your database must be same. like if your database name in your old hosting is abc_wrdp1 then your new host's DB name must be same as abc_wrdp1 after this you are able to upload your database. I have another option just export your database from your old hosting account from the feature export in phpmyadmin. and look for the new database name in your new account and rename the name of that sql file. and upload this will work for you.
It seems you are only having one issue with one database. Why not just manually export and import it? It will save you a lot more time instead of trying to get the control panels to do it.
The problem was solved or at least the opener has not returned. Thread closed.