Troubleshooting: MySQL/MariaDB Error #1044 & #1045 Access Denied for User

Posted on by Echo Diaz | Updated:
Reading Time: 2 minutes

When using PhpMyAdmin, it’s essential to have the correct user permissions to create edits/writes to the database.  Otherwise, insufficient permissions can lead to  errors like the ones pictured below “#1044 – Access denied for user …[using password: YES]” and “#1045 – Access denied for user…[using password: YES]”.  In our tutorial, we’ll show you how to correct this issue using the command line terminal.  Let’s get started!

#1044 - Access denied for user …[using password: YES] #1045 - Access denied for user…[using password: YES]
Pre-flight

  • Root access to the server hosting PhpMyAdmin

Step 1: Connect to your server using SSH, from your computer’s terminal.

ssh root@yourhostname.com

Step 2: When the MariaDB was installed a default user was also created, for our Ubuntu install this details of this user can be found at /etc/dbconfig-common/phpmyadmin.conf. We’ll be talking our default user, phpmyadmin, and granting them permissions to create a database within PhpMyAdmin.

MySQL;

grant create on *.* to phpmyadmin@localhost;

Note

Alternatively, if you are trying to delete a database you can use this command replacing username with the user in question.

UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='username';
FLUSH PRIVILEGES;
GRANT ALL ON *.* TO 'username'@'localhost';

Step 3: Log into PhpMyAdmin, by going to http://yourhostname.com/phpmyadmin.

phpMyAdmin login screen

Step 4: Create a Database within PhpMyAdmin by selecting the SQL tab and running a command to create the database. Paste in the following command, replacing cooldb with the database name and selecting Go.

CREATE DATABASE cooldb;

Step 5: You’ll know the database was created by the success message and it’ll appear in the left-hand side menu bar.

CREATE DATABASE cooldb;

Liquid Web server customers get the convenience of calling our support techs 24/7.  Our technicians have a wealth of knowledge and can help with common issues like the ones outlined in this article.  Make the switch and get around the clock support.

Avatar for Echo Diaz

About the Author: Echo Diaz

Throughout Echo's four year stint as a technical support specialist, her passion for breaking down complex concepts had to lead to a career in professional writing. As a former top tier support specialist, she added a distinctive element to her written work that spoke to customer feedback and concerns. Echo occasionally pops her head out from behind her computer to watch her dog energetically run around the yard and unabashedly shovels money into buying tickets to see her favorite musical artists.

Latest Articles

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article