Blog

12/08/2019

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



When using phpMyAdmin, it’s essential to have the correct user permissions to create edits/writes to the database.  Otherwise insufficent 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!


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.

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.

Liquid Web server customer’s get the convenience of calling our support tech 24/7.  Our technicians have a wealth of knowledge and can help with common issues like this.  Make the switch and get free migration with round the clock support.

14/08/2019

How to KVM, QEMU start or stop virtual machine from command line (CLI)

KVM or Kernel Based Virtual Machine is a popular virtualization technology. It allows you to run virtual guest machines over a host machine. To start...
14/08/2019

How to Docker backup Saving and restoring your volumes

Running a Docker volume backup First, we spin up a temporary container, and we mount the backup folder and the target Docker volume to this container....
12/08/2019

How to Start and Enable Firewalld on CentOS 7

In this article, we discuss how to start and enable firewalld. It is highly recommended that you have a firewall protecting your server.Pre-Flight CheckThese...