This page will assist you with troubleshooting a MySQL - 1044 "Access Denied" Error Message. A MySQL denial error sometimes occurs when a database is imported through phpmyadmin.
Note: If you are using cPanel, databases must be created using either the phpMyAdmin or the MySQL Database option.
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 this example, the database we are trying to import is named employees.
When using phpMyAdmin to attempt to import such a file, you will receive an error message similar to:
In this scenario, the cPanel username is "training." Because of cPanel's database naming conventions, all database names must begin with the cPanel username followed by an _. Using this format you can only creat a database named training_employees.
The reason this import failed is because of the following line in the .sql file (show above)
CREATE DATABASE employees;
Again, you cannot create a database named employees, however I can create a database named training_employees.
If I change the line that says: CREATE DATABASE so that it creates: training_employees instead of employees it will again fail with the following message:
When using cPanel, databases must be created within the cPanel itself.
Here are the steps to correct this issue:
1. Create the training_employees database within cPanel
2. Comment out the CREATE DATABASE command in my .sql file
To do this, simply change:
CREATE DATABASE employees;
to
-- CREATE DATABASE employees;
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 training_employees database, and then import as normal.
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: | 757-416-6627 | Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!