• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tips and Tricks HQ

  • Home
  • Projects
    • All Projects
    • Simple WP Shopping Cart
    • WP Express Checkout Plugin
    • Accept Stripe Payments
    • WP Download Monitor
    • Easy HTTPS Redirection
    • WP Security and Firewall Plugin
    • WP eStore Plugin
    • WP Affiliate Platform
    • WP eMember
  • Products
    • All Products
    • Checkout
  • Support
    • Support Portal
    • Customer Only Forum
    • WP eStore Documentation
    • WP Affiliate Software Documentation
    • WP eMember Documentation
  • Contact

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

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

Last updated: April 27, 2013





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 (old-host.com) to another host (new-host.com) 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`
—
CREATE DATABASE `
tips_db` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `
tips_db`;

Example of the sql database file after modifying

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

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:

  • How to import/export database via PHPMyAdmin
  • How to move WordPress to a new host

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

Related Posts

  • How to fix WordPress.com Stats plugin showing zero (0) visitors!
  • Protect your WordPress site/blog from comment spam trick
  • How to Uninstall and Reinstall WordPress
  • Apache Mod Security update, How to Fix ‘Error 406’ or ‘Not Acceptable’ issue

Web Development,  Wordpress Database,  database import,  Troubleshooting,  Web Development,  web masters,  Wordpress

Reader Interactions

Comments (60 responses)

  1. Margie Burke says:
    March 12, 2017 at 2:03 am

    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:
    October 2, 2014 at 11:20 am

    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:
    June 23, 2014 at 4:55 am

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

  4. Cy says:
    April 3, 2014 at 10:31 am

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

  5. KJ says:
    March 3, 2014 at 9:42 am

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

  6. Kei says:
    November 11, 2013 at 5:17 am

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

  7. Danny says:
    October 10, 2013 at 4:18 pm

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

  8. John says:
    August 15, 2013 at 1:49 pm

    Worked perfectly. Thank you so much

  9. admin says:
    August 7, 2013 at 4:16 am

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

  10. Sherry says:
    August 7, 2013 at 12:04 am

    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

« Older Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured & Popular Articles

Video Answers to Top WordPress QuestionsWordPress Optimization Tips and Tricks for Better Performance and SpeedEssential WordPress Security Tips - Is Your Blog Protected?WordPress Simple PayPal Shopping Cart PluginTop 15 Search Engine Optimization (SEO) Techniques I Forget to DoList of the Best and Must Use WordPress PluginsHow do I Start a Blog and Make Money Online?Good Domain Name Picking Tips for Your Blog SetupFind Out Which WordPress Web Hosting Company Offers the Cheapest and Reliable Web Hosting Solution

Featured WordPress Plugins

WP Express Checkout Plugin
wordpress estore plugin
wordpress membership plugin
wordpress affiliate plugin

Recent Posts

  • How to Use Browser Developer Tools to Inspect Elements and [...]
  • Accept Donations via PayPal from Your WordPress Site Easil [...]
  • Buy Now Button Graphics for eCommerce Websites [...]
  • Subscription Button Graphics for eCommerce Websites [...]
  • Adding PayPal Payment Buttons to Your WordPress Sidebar Ea [...]

Comment & Socialize

  • @Rob, We have just released ...
    - admin
  • I installed the plugin a co ...
    - Rob
  • @Sebastian, We've released ...
    - admin
  • I've used this plugin on a ...
    - Sebastian Djupsjöbacka
  • @John, this plugin doesn't ...
    - admin

Check out our solutions

View our WordPress plugin collection and start using them on your site.

Our WordPress Solutions

Footer

Company

  • About
  • Privacy Policy
  • Terms and Conditions
  • Affiliate Login

Top WordPress Plugins

  • Simple Shopping Cart
  • PayPal Donations
  • WP Express Checkout
  • WP eStore
  • WP eMember

Blogging Tips

  • How to Start a Blog
  • Selecting a Good Domain
  • Cheap WP Hosting
  • WP Video Tutorials
  • Simple SEO Tips

Search


Keep In Touch

Copyright © 2025 | Tips and Tricks HQ