I have installed a fresh Laravel project (5.7.5
) on my Mac (10.13.6
).
I have installed mysql (8.0.12) with brew install mysql
and the laravel project with the laravel create laraveltest
command.
Laravel is running in the Valet environment (2.1.1).
I can connect to the Mysql server with the Sequel Pro client (127.0.0.0, root with no password) and also by the command line mysql -uroot
.
I can create a database create database laraveltest
and use the database use laraveltest
but when I try migrating the database php artisan migrate
i get an error:
'PDOException : SQLSTATE[HY000] [2006] MySQL server has gone away')
So it seems that Laravel can't connect to my mysql
server.
My .env file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laraveltest
DB_USERNAME=root
DB_PASSWORD=
I tried uninstalling/installing mysql. restarting the computer. deleting/creating the laravel project. same error.
Any ideas what I can try to resolve this?