thedevdojo / php-login-script

This is a simple PHP login script using PHP, PDO, and MySQL
95 stars 71 forks source link

Connection failed: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) #3

Open ashikv-dev opened 4 years ago

ashikv-dev commented 4 years ago

please help me resolve this problem when I open the index,php

sammirzaev commented 4 years ago

there are might b issue with mysql connection, try to migrate if it is not try below the commands: php artisan cache:clear php artisan config:clear php artisan route:clear

check your .env file properly. there is may be your phpmyadmin username or password wrong or database name which created not correct, Please let me know it will not help

i01107 commented 4 years ago

Try to login to mysql in your terminal / command prompt first. If you succeeded, apply the same credentials to database.php file. If you somehow already change the credentials, then you have to adjust database.php file accordingly.

sammirzaev commented 4 years ago

pls povide me with codes and errors

sammirzaev commented 4 years ago

your .env inside

harrazmasri commented 4 years ago

well if your local host tool weren't set any password like mine (default), then go to database.php and remove the password i mean (root), $password = 'root';

deepu0111 commented 3 years ago

please help me resolve this problem when I open the index,php

well its simple just set password from 'root' to empty ellipsis= define('DB_PASSWORD', '');