0

I'm trying to learn MySQL but I can't even do basic stuff like migrate and it's becoming super frustrating.

So I made a database, a model and a migration and now I'm trying to migrate the table with php artisan migrate.

But that's where I get this error:

PDOException  : SQLSTATE[HY000] [2006] MySQL server has gone away

  at /Users/marijn/Desktop/code/laravel-6-beginner/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
    66|         if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
    67|             return new PDOConnection($dsn, $username, $password, $options);
    68|         }
    69| 
  > 70|         return new PDO($dsn, $username, $password, $options);
    71|     }
    72| 
    73|     /**
    74|      * Determine if the connection is persistent.

  Exception trace:

  1   PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=laravel", "root", "secret", [])
      /Users/marijn/Desktop/code/laravel-6-beginner/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

  2   Illuminate\Database\Connectors\Connector::createPdoConnection("mysql:host=127.0.0.1;port=3306;dbname=laravel", "root", "secret", [])
      /Users/marijn/Desktop/code/laravel-6-beginner/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:100

  Please use the argument -v to see more details.

Why am I getting this error and how and I fix it?

Paulo Hgo
  • 834
  • 1
  • 11
  • 26
FonsVC
  • 411
  • 1
  • 6
  • 13
  • Does this answer your question? [mysql server has gone away error during installing migration (laravel)](https://stackoverflow.com/questions/35036547/mysql-server-has-gone-away-error-during-installing-migration-laravel) – Hafez Divandari Dec 22 '19 at 19:53
  • Not really.. could you explain how I can do these tests? I think everything is working like it should but I feel like I don't know what I'm doing... – FonsVC Dec 22 '19 at 20:36

0 Answers0