Transfering sql database using phpmyadmin

When trying to transfer a wordpress sql database using phpmyadmin from my existing Windows server to my new Linux server I get the following error message see below.

#1044 - Access denied for user 'name'@'%' to database 'wp_name'

I've replaced the name of the database and username with name, I've tried keeping the database name the same and it says it already exists, I've kept the username the same as the current username and it says it doesn't have permission, where am I going wrong?

I've searched the error message and nothing helps me resolve this, I have a number of domains to transfer with wordpress databases and this is stopping me from doing so at present.
Daniel ForresterDirectorAsked:
Who is Participating?
Julian HansenConnect With a Mentor Commented:
The message is telling you what you need to know that the user account you are using does not have permission to logon to that database.

Things to look for are:

When you  transferred the database did the script include a create database statement or a use database satement.

Did you create a database before hand and give a user rights to that database?

Proper process for this is as follows

1. Create the database on the destination server
2. Create the user account to access the new database
3. Export data from existing data but don't include create or use database statements - check the exported file for these and remove if they are there.
4. log into new database with id created in 2.
5. Import new database script
6. Check that import was successful in PHPMyAdmin - ensure all tables are there.
7. Update wordpress config with database name (from step 1) username and password from step 2.
8. If this is the first time you are using the new server verify the server connection details - whether you need to use localhost or an IP or a specific host name - your ISP will be able to tell this. You will also need to determine if the database is configured for a different port from the default 3306 (sometimes it is changed to 3307 - but again check with your ISP).

That should work.
Daniel ForresterDirectorAuthor Commented:
Can I send you a copy of the backup so you can see what lines I need to delete?
Daniel ForresterDirectorAuthor Commented:
Don't worry think I've sorted it.
Daniel ForresterDirectorAuthor Commented:
Thanks for your help, I had to delete a line from the script.
Julian HansenCommented:
Cool - glad to be of help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.