I have a laravel project on my Godaddy shared server and have been working on it for the past several weeks including running many 'php artisan migrate' commands. Inside my .env file I have been using the username and password of the entire cPanel. For security I decided to create a new DB users who only has privileges to the database I'm working on and use that inside the .env file. However, no matter what I do, I get the following error:
Illuminate\Database\QueryException : SQLSTATE[28000] [1045] Access denied for user 'seconduser'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = Custom_Database and table_name = migrations)
I've followed every solution to this error I can find which advise me to double, and triple check my credentials (which I can confirm are 100% correct) being used in the .env file.
I've also tried creating a third DB user account which also has full privileges to the DB, but once again, I get the same error.
I've also tried changing my .env $host variables to the actual IP of my server, but the error is the same.
Finally, it's worth mentioning that, the way I'm creating my database users is via the GoDaddy MySQL Databases panel like they recommend and not directly inside PHPMyAdmin.
My .env file is below, any help would be much appreciated:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=Custom_Database
DB_USERNAME=seconduser
DB_PASSWORD=C0mp13XPA$$W0rD
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"