SQLITE Access denied error in Laravel - laravel

I am using sqlite as my default database driver.
I already connected the database using .env and also seeded some data using tinker.
N.B: Data is inserted correctly in my database. Database name is
database.sqlite
But when I try to login using email and password created with tinker it shows the following error.
"SQLSTATE[HY000] [1045] Access denied for user 'homestead'#'localhost' (using password: YES) (SQL: select * from `users` where `email` = ryleigh12#example.net limit 1)
here is the image showing that error

If you are using the PHP's default web server (php artisan serve) you need to restart your server after any change in your .env file.

Related

Laravel Passport Passport::hashClientSecrets() always gives unathenticated error Error

I am using laravel 9 passport for authenticating user by issuing personal access token.
First I generated client id and client secret by running the following command
php artisan passport:client --personal
and then generated personal access token for a user which is working fine. But when I create hashed secret key by adding
Passport::hashClientSecrets();
into AuthServiceProvider.php and try to create token, I always get the following error
League\OAuth2\Server\Exception\OAuthServerException: client authentication failed...
But when I uncomment the following then everything starts working fine
Passport::hashClientSecrets();
Can anyone explain what I am missing and how can I create personal access token using hashed secret key?

I have issues with laravel database connection, SQLSTATE[HY000] [1045] Access denied for user

Please who can help me with this solution. My laravel website display
SQLSTATE[HY000] [1045] Access denied for user 'cahresa1_new'#'localhost' (using password: YES) (SQL: select * from sessions where id = v3oQ973C7gtMnvO2V4JQHu8p24TibIj7PRE6nHer limit 1)
And I used the correct details in env file.
Issues shared below
https://flareapp.io/share/x5MLzqe7#F42
I tried connecting my database to view the website but it kept showing errors

SQLSTATE[HY000] [1045] Access denied for user 'root'#'192.168.112.3' (using password: YES)

I am using three containers(Mysql, nginx, php) All the containers are running perfectly fine but when entered data has to be saved in DataBase I am getting access denied error. I have checked multiple times that the username and password are mentioned correctly both in .env file and docker-compose.yml. Can anyone help me to figure out this. Thanks a lot in advance.
if you’re using mysql make sure you already grant access first for ‘root’ user. or you can make a new user and grant access to the db. if you still want using root user, you probably have to change password of root user using ALTER function

set laravel mail setting to log file

I just start to learning laravel and now I have a problem with mail settings.
I want to send reset password email to the log file of the project and for this I change the .env file settings from MAIL_DRIVER = smtp to MAIL_DRIVER = log
I also change the mail.php settings and reset my server because I use (php artisan serve) command.
still i receive following error
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mytodo.password_resets' doesn't exist (SQL: delete from password_resets where email = Ali#gmail.com
I don't know why it is search for table.
I also see the following question it has same problem but my problem doesn't solve by their instruction.
Laravel Mail to Log
please help me is there anything else i should try.
A table must be created to store the password reset tokens and There is our processes :
Get reset request
Generate token
Store token in DB
Send email
In your way, you only change step 4. You need store tokens and you should have a password_resets table in your database.

Laravel5 - artisan down command trying to access database?

I've deployied a project on a new server. When i issue
php artisan down
i get
[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using pas
sword: YES)
Why is it trying to access the database? Why root? I'm confused.
Down does not try to access database, tried myself, so you may have:
A registered ServiceProvider trying to access it
A Middleware trying to access it (if you run it via a web route); or
Some other class doing it

Resources