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

ranganath's avatar

Error in:>> php artisan migrate

i tried to migration of my database with accurate "username" and "password".

and also, i done upto

php artisan make:migration create_test(MyTableName)_table - - create test The file wil be created with some time stemp. But, the problam is in next step. >>php artisan migrate

Even, I given My Database Name and password exactly and i mention these details in ".env" file also.. then

I got somePDOException with message 'SQLSTATE[HY000] [1044] Access denied for user ' ' @ 'localhost' to database in "laravel5" ===> (its My Database Name).

0 likes
4 replies
kevdotbadger's avatar

Apparently the user you supplied is empty (or at least a space).

sitesense's avatar

Does the database "laravel5" exist? Did you create it? Also the user?

Are you using Homestead?

ranganath's avatar

Yup!!!, Its taking empty user, i donno why? and "Laravel5" and "user" are created by me only......

willvincent's avatar

Did you grant that user permissions for that DB?

Easiest (albeit not secure, so not good for production):

GRANT ALL on Laravel5.* to 'user'@'localhost' identified by 'supersecretpassword';

Please or to participate in this conversation.