How to import WordPress SQL database backup file without having ‘create new database’ privileges in phpMyAdmin

In this article I have explained how you can import your WordPress SQL database backup file even when you do not have the ‘create new database’ privilege in phpMyAdmin. This is particularly useful when you are trying to import the SQL database as part of transferring your site from one host ( to another host ( and your new host doesn’t have the ‘Create new database’ privilege in phpMyAdmin.

In your phpMyAdmin page check for the ‘create new database’ privilege. If the privilege settings looks like the example shown below then your database import following the normal method is going to fail as it will try to create a database and you don’t have permission to do that.

create new database no privilege

No privilege to create new database

You will get the following error when trying to import the database file:

#1044 – Access denied for user ‘username’@’localhost’ to database ‘database_name’

To get around this problem and to complete importing your database to your new host do the following:

  1. Login to your cPanel and click on ‘MySQL Databases’.
  2. Create a new database with your preferred name (I am going to use the name ‘newDB‘ for easy reference. You should have privilege to create a new database through this MySQL Database panel even though you don’t have privilege to create new database through phpMyAdmin).
  3. Open the sql database file that you are using for importing (e.g. ‘localhost.sql‘) in a text editor such as notepad.
  4. Search for the text “CREATE DATABASE”
  5. Delete this line containing the create database command.
  6. In the next line change the database name (tips_db in this case) to the newly created database (newDB) in step2 after the word ‘USE’.
  7. Now use the import wizard from phpMyAdmin to import the database and it will use the already created database to import all the tables without any problem.

Example of the sql database file before modifying

— Database: `tips_db`

tips_db` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Example of the sql database file after modifying

CREATE DATABASE `applewoo_applewood` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Note: Beth pointed out the following in the comment section below which is good to remember:

You have to make sure that you do a search for "CREATE DATABASE" to delete it and make the change to the "USE tips_db" Line in ALL the places it appears.

What to do if you can’t do the above trick?

You could request your web hosting provider to add database creation privilege to your phpMyAdmin.

Also check out the following two tutorials which should be very helpful:

Hope this will help anyone having a similar problem. Feel free to share your thoughts by leaving comments in the comment area below.

Comments (64 responses)

  1. Margie Burke says:

    Thanks sooo much for this article! This was a HUGE help in getting my WordPress site moved over to another hosting account – I’d been banging my head on the database transfer until I found this. Wonderful!

  2. Dewald says:

    Fantastic fix and incredibly easy to do. I had issues with the database being made successfully in cPanel but not showing up in PHPMyAdmin though, but the hosting support helped me. Thanks!

  3. Geoffrey Hunter says:

    Perfect! Just the solution I needed to fix a database import problem which has had me stuck for hours.

  4. Cy says:

    Wow! I have been struggling with this for hours..
    thanks so much for such useful post.

  5. KJ says:

    Thanks so much for your help! Learning here, tried a bunch of other things, but this solved the problem!

  6. Kei says:

    Thank you so much!! I think WordPress should have this article on their site as well.

  7. Danny says:

    Thank U! That was a big help.
    Many many thanks.

  8. John says:

    Worked perfectly. Thank you so much

  9. admin says:

    @Sherry, What exact error do you get when you try to import the database content?

  10. Sherry says:

    Hi Admin.
    I am still getting the same error .. I got the backup of my complete database including information schema. so when i import the database i got same error. what i have to do please help me. As I did not understand the above trick properly.
    Thanks, waiting for your response

  11. Fazil Ali says:

    Thank You So Much for your solution. Actually its was an error which i am facing first time when importing the WP tables to new database. and I have spent my time too by checking for a solution. But you saved my Time. Thank You. 🙂

  12. Robert says:

    Thank you so much for this solution – customer support and a bunch of other google searches were not helpful, as no one pointed out the need to delete the “CREATE DATABASE” line. Worked like a charm – thank you!

  13. kelskc says:

    THANK YOU!! I have been searching everywhere for this solution (not knowing it was this) and not only did it work you made it so easy… you are amazing!

  14. Beth olson says:

    It’s an easy fix!!

    I also kept getting the error: “#1044 – Access denied for user ‘[email protected]%’ to database ‘b6_8637033_wordpress’

    You have to make sure that you do a search for “CREATE DATABASE” to delete it and make the change to the “USE tips_db” Line in ALL the places it appears. I realized that I was getting that error because I was only changing that information in one place but it was actually occurring in TWO places in the code.
    hope that helps!

Speak Your Mind