On a fresh Laravel install, running Valet, app works fine.
Problem is trying to set up a database, using MySQL. I can create a database, tell MySQL to use it, but can't do anything with it:
mysql> create database foobar;
Query OK, 1 row affected (0.09 sec)
mysql> use foobar;
Database changed
mysql> show tables;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist
If I try php artisan migrate
i get the following:
PDOException : SQLSTATE[HY000] [2006] MySQL server has gone away
at /Users/isaacfennell/Sites/anything/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
64| if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
65| return new PDOConnection($dsn, $username, $password, $options);
66| }
67|
> 68| return new PDO($dsn, $username, $password, $options);
69| }
70|
71| /**
72| * Determine if the connection is persistent.
Exception trace:
1 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=anything", "root", "", [])
/Users/isaacfennell/Sites/anything/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
2 Illuminate\Database\Connectors\Connector::createPdoConnection("mysql:host=127.0.0.1;port=3306;dbname=anything", "root", "", [])
/Users/isaacfennell/Sites/anything/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:98
Please use the argument -v to see more details.
I'm new to Laravel and MySQL and can't figure out how to solve this - what's going on here? Thanks
Solved the first issue:
Run
mysql_upgrade -u root
Found here: Mysql Error:The user specified as a definer ('mysql.infoschema'@'localhost') does not exist' when trying to dump tablespaces
BUT running
php artisan migrate
still gives the same error output as above…