Normally the host for the database is localhost so check your .env file that DB_HOST=127.0.0.1 is set
Error connecting to database after server change
I have recently changed server and uploaded my database to the server, for the live website i made no changes to my env and everything works the same. But in my php storm development i have had to change the ip(db host) and despite the username and password being the same as the live website i am getting an error suggesting i can't access.
SQLSTATE[HY000] [1045] Access denied for user 'connect'@'xxxxxx' (using password: YES)
I have cleared config and cache and tried launching php artisan again but get the same issue. i have even brought in the env from the server(live website) and changed the DB Host to match the IP of the server but then the error occurs. Does anyone know how i fix this error, could it be an issue with the fact the database was imported from another server?
I don't use cpanel, but does this help;
https://www.liquidweb.com/kb/enable-remote-mysql-connections-in-cpanel/
You might need to check with your specific host
Please or to participate in this conversation.