Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9029765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:19:27+00:00 2026-06-16T07:19:27+00:00

I have a recently set up VPS with cPanel. I’ve made a user and

  • 0

I have a recently set up VPS with cPanel.

I’ve made a user and created a database, and now I would like to import a database onto it.

However, when I try I get the error message

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

I suspect that this can be fixed with WHM, but I do not feel like trial and error just yet.
How would I go about fixing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:19:28+00:00Added an answer on June 16, 2026 at 7:19 am

    When you import a database using phpMyAdmin, normally you do so by importing a text file with a .sql extension. Here is a section of code that may be in a .sql database backup. In your example, the database you are trying to import is named database.

    -- phpMyAdmin SQL Dump
    -- version 2.11.9.5
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Apr 02, 2010 at 08:01 AM
    -- Server version: 5.0.81
    -- PHP Version: 5.2.6
    
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    
    CREATE DATABASE database;
    -- --------------------------------------------------------
    --
    -- Table structure for table `table`
    --
    
    CREATE TABLE IF NOT EXISTS `table` (
    `column1` text NOT NULL,
    `column2` text NOT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    

    When using phpMyAdmin to attempt to import such a file, you will receive an error message similar to:

    Error
    
    SQL query:
    
    CREATE DATABASE database;
    
    MySQL said: Documentation
    #1044 - Access denied for user 'user'@'localhost' to database 'database'
    

    In this scenario, the cPanel username is user. Because of cPanel’s database naming conventions, all database names must begin with the cPanel username followed by _. Using this format you can only creat a database named user_database.

    The reason this import failed is because of the following line in the .sql file…

    CREATE DATABASE database;
    

    Again, you cannot create a database named database, however you can create a database named user_database.

    If you change the line that says: CREATE DATABASE so that it creates: user_database instead of database it will again fail with the following message:

    Error
    
    SQL query:
    
    CREATE DATABASE user_database;
    
    MySQL said: Documentation
    #1044 - Access denied for user 'user'@'localhost' to database 'user_database'
    

    When using cPanel, databases must be created within the cPanel itself.

    Here are the steps to correct thi sissue:

    1. Create the user_database database within cPanel
    2. Comment out the CREATE DATABASE command in my .sql file

      To do this, simply change:

      CREATE DATABASE database;

      to

      -- CREATE DATABASE database;

      You are simply adding dash-dash-space to the front of the line to comment it out so that it will not be executed.

    3. Log into phpMyAdmin, access the user_database database, and then import as normal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently set up a bugzilla instance for bug tracking and would like
I have recently decided to adopted Codeigniter as a PHP framework. I would like
I have recently set up a VPS and am trying to deploy a rails
I have recently purchased a domain mydomainname.ca for my web mydomainname.com i would like
I've recently set up bare, shared repository on a personal server and would like
I have been recently trying to set a cookie holding the user's name, it
I recently discovered that when you have a page set to session readonly and
I have a rails environment which I set-up with macports. I recently updated macports
I recently started using NERDTree with vim, and have set it to automatically open
I've got MacVim and Janus installed. I have recently added set rnu to my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.