简体   繁体   中英

Laravel app not connecting after deployment to live server

After deploying my Laravel app to inMotion hosting, I am having issues connecting to the database. What is strange is that if I use a PHP script to test the connection, it works. However, when trying to login I get this error:

 SQLSTATE[HY000] [1045] Access denied for user @'localhost' (using password: YES) (SQL: select * from `users` where `email` =.com limit

I am using the exact same username and password in the.env file as I did in the PHP test script. I have tried clearing the cache and also changing the password for the database as well as my username.

Better if you can clear the config cache and see. You can use the following command to clear the config cache in Laravel:

php artisan config:cache

Turns out it was the password in the.env file. It had special characters, so I had to add quotation marks around it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM