So, when I was creating my first laravel 6 app and trying to connect it to the database, I got these two errors:
- PDOException : SQLSTATE[HY000]  MySQL server has gone away
Illuminate\Database\QueryException : SQLSTATE[HY000]  Connection refused (SQL: select * from information_schema.tables where table_schema = chat_db and table_name = migrations and table_type = 'BASE TABLE')
As I Googled around for a bit, I found 2 very simple solutions!
- For the first problem, you have to edit your MySQL configuration file which should be in
/usr/local/etc/my.cnfin your Mac.
Open the file and add the following line to it:
- And for the second error, go to your laravel app and open the .env file and then, change your
You're good to go now!