cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

SOLVED

ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

I am trying to install Magento 1.9 on a test server following these instructions:
http://devdocs.magento.com/guides/m1x/install/installing_install.html

However when I try to create a database I run into this issue:
Under "Creating a Magento Database Instance"
 -> 5. Test the database instance

  max@ubuntu:~$ mysql -u magento -p
  Enter password:
  ERROR 1045 (28000): Access denied for user 'magento'@'localhost' (using password: YES)
 
  max@ubuntu:~$ mysql -u magento -p
  Enter password:
  ERROR 1045 (28000): Access denied for user 'magento'@'localhost' (using password: NO)

This is before I am even supposed to extract Magento.


When I google I find some forum discussions with similar problems but all answers seem to refer to
/app/etc/local.xml for the data base credentials.  I don't know where to find that.

My problem might be a different one though.

I am using
 - Ubuntu 16.04.4 LTS
 - Apache:  Server version: Apache/2.4.18 (Ubuntu)
 - mysql:   mysql  Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using  EditLine wrapper
 - php:     PHP 5.6.34-1+ubuntu16.04.1+deb.sury.org+1 (cli)

1 ACCEPTED SOLUTION

Accepted Solutions

Re: ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

Hi @marco_schindler,

 

1) If your Magento store is already installed you'll find the app/etc/local.xml file into your Magento directory.

I don't know were it could be (normally you can check on /var/www/html but it can be different on your server).

 

2) You'll need to know, at least, how to connect to your database.

View solution in original post

5 REPLIES 5

Re: ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

Hi @marco_schindler,

 

It seems you have a credentials problem.

If you aren't allwoed to connect through shell the problem seems to be the Mysql user and/or password.

Can you confirm those credentials work?

Re: ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

Hi @Damian Culotta,

 

I think you are right about the credentials being the issue.

The thing is though, that I'm not familiar with data base administration.

I have got some coursework experience with SQL syntax from 13 years ago, but that's it.

 

So question 1 would be, how do I check or fix the credential issue?

Does it have to do with the "/app/etc/local.xml" file that I read about but don't know where to find?

 

Or question 2, do I have get familiar with data base administration first, before starting to work with Magento?

Re: ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

Hi @marco_schindler,

 

1) If your Magento store is already installed you'll find the app/etc/local.xml file into your Magento directory.

I don't know were it could be (normally you can check on /var/www/html but it can be different on your server).

 

2) You'll need to know, at least, how to connect to your database.

Re: ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

use the database name you created as a password

Re: ERROR 1045 (28000): Access denied for user 'magento'@'localhost'

Hello,

Your error indicates a MySQL authentication issue. you can follow these steps:

  1. Ensure Correct Password: Make sure you're entering the correct password for the 'magento' MySQL user.
  2. Reset Password (if unsure):
    Login to MySQL with the root user: mysql -u root -p.
    Set a new password:
    FLUSH PRIVILEGES;
    SET PASSWORD FOR 'magento'@'localhost' = PASSWORD('newpassword');
  3. Check User Privileges: Ensure 'magento' user has necessary privileges.
    From the MySQL prompt: SHOW GRANTS FOR 'magento'@'localhost';.
    If insufficient, grant required privileges.
  4. /app/etc/local.xml: This file contains Magento's database credentials. However, since you haven't extracted Magento yet, this isn't the issue. It's purely a MySQL access problem.
    If problems persist, consider recreating the 'magento' MySQL user or checking for any specific firewalls or configurations blocking access.

Eden Wheeler
Splunk Course