Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Aqeel94321's avatar

Access denied for user

My project work fine for localhost but when i deploy to server and want to login it through that error.

Illuminate\Database\QueryException SQLSTATE[42000] [1044] Access denied for user 'nhkhan_root'@'localhost' to database 'nhkhan_daycare' (SQL: select * from admins where email = aqeelkhadim93@gmail.com limit 1)

have any idea what the issue is?

0 likes
4 replies
Sinnbeck's avatar
  1. Is the database on the same server
  2. Are you sure you have re correct username/password
  3. Does it work if you log in using either terminal or a database manager
Sinnbeck's avatar

So you have tried logging onto the mysql server using something like the mysql commandline tool?

What access does nhkhan_root have (i mean where can the user get access.. localhost or %)

codebullet's avatar

This user "nhkhan_root" have access to the database? maybe try adding new user and password the database, then try again may be "nhkhan_root" don't have database access or restricted

Please or to participate in this conversation.