Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
505 views
in Technique[技术] by (71.8m points)

php - mysql server has gone away error during installing migration (laravel)

So I am using my cmd on my laravel folder and I tried to do (php artisan migrate:install). 2 errors came up.

  1. [PDOException] SQLSTATE[HY000] [2006] MySQL server has gone away

  2. [ErrorException] PDO::__construct(): MySQL server has gone away

Can anyone please explain what I did wrong?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is not a Laravel issue, but a general MySQL Issue. Maybe the server is not running. Are you sure you're running MySQL in the background?

Check this link: MySQL Gone Away

Do the following checks in your system:

  1. The Database Engine is running
  2. You have created your database
  3. You have created an user and granted permissions to the database
  4. You have setup the user and the database in your Laravel's .env file.

After this, try to run the migrations command again, which is:

php artisan migrate

As explained Here

Let us know if that helps :).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...