close

[Solved] How to fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user”

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error How to fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user” in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How to fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user” Error Occurs?

Today I get the following error How to fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user” in php.

How To Solve fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user” Error ?

  1. How To Solve fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user” Error ?

    To Solve fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user” Error For Mac users using MAMP, if the accepted answer was not enough to solve this issue, like me, add socket to the .env file.

  2. How to fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user”

    To Solve fix “Illuminate\Database\QueryException: SQLSTATE[HY000] [1044] Access denied for user” Error For Mac users using MAMP, if the accepted answer was not enough to solve this issue, like me, add socket to the .env file.

Solution 1

Try this, go to your .env file, change the name of the database. Go to your phpmyadmin, create a new database with the new name in your .env file.

Then run php artisan migrate

Solution 2

For Mac users using MAMP, if the accepted answer was not enough to solve this issue, like me, add socket to the .env file.

DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock
//or
UNIX_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock

The variable should match with the setting on config > database.php. Look for connections > mysql > unix_socket

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment