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

Before installing Magento I installed Apache, PHP and the MySQL 5.7.26-0ubuntu0.18.04.1 for Linux on x86_64 Ubuntu. And created the database.

For verify the mysql -u magento -p It prompted password, I give the both Password that i’ve set for mysql and this database(magento) too. But it’s giving:

Error: ERROR 1045 (28000): Access denied for user 'magento'@'localhost' (using password: YES)


I’ve search for the solution that i got to change local.xml file or env.php But I’ve not found these file on Ubuntu. I’m new with Both Magento and Ubuntu Please guide me to Solve this.

This issue doesn’t have anything to do with Magento 2. Also, the reason why you can’t find local.xml and env.php is because you said you haven’t installed Magento yet. Therefore, the files won’t exist yet.

The error is telling you the password (or even username) you’re entering is incorrect.

For Linux related enquiries, please seek https://unix.stackexchange.com/

If your plan is to build and develop a Magento 2 store, you should focus on learning about LAMP Stacks first. Then once developing those skills, move onto Magento 2. It comes across that you might be trying to run before you can walk.

1 Like