SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
-
I must be stupid, and I'm surprised no one else has had this problem yet but I run into the following problem:
After installing Laragon and following the videos on laracasts.com, I'm now running into the problem of not being able to run migrations.
Even when I try to runphp artisan migrate:status
I get the following error:[PDOException] SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
My
.env
file looks like this (it's the default file)DB_HOST=localhost DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret
All these settings are from the default installation. What am I doing wrong, and how can I fix it?
-
@Undutchable: No worry
- First, click Start to ensure MySQL is running
then open **Terminal ** and create a database, example "homestead"
mysqladmin -u root create 'homestead'
- Change your .env file to
DB_HOST=localhost DB_DATABASE=homestead DB_USERNAME=root DB_PASSWORD=
- First, click Start to ensure MySQL is running
-
Thanks. It wasn't clear to me that the databases didn't exist yet.
-
You're welcome
-
@leokhoa I immediately registered an account just to say this: i have spent three days trying to figure this out and nowhere have i seen to create a database the way you explained it. i am so happy. thank you so much.
-
@farmanp : You're welcome
-
@leokhoa i have also this problem when i write this command on terminal it shows that mysqladmin is not recognised as an internal or external command
-
@Ibtsam-Ali : Which terminal? Any images?
Hint: You should use Laragon's Terminal.
-
@Ibtsam-Ali Add laragon to your path and you can be able to access even composer, mariadb,yarn etc from any terminal on your machin
STEPS 1
Open laragon click on menu->tools->Path->Add laragon to Path
STEP 2
Congrats you are a geek