問(wèn)題描述
所以我在我的 Laravel 文件夾上使用我的 cmd 并且我嘗試這樣做(php artisan migrate:install).出現(xiàn)了 2 個(gè)錯(cuò)誤.
So I am using my cmd on my laravel folder and I tried to do (php artisan migrate:install). 2 errors came up.
[PDOException] SQLSTATE[HY000] [2006] MySQL 服務(wù)器消失了
[PDOException] SQLSTATE[HY000] [2006] MySQL server has gone away
[ErrorException] PDO::__construct(): MySQL 服務(wù)器已經(jīng)消失
[ErrorException] PDO::__construct(): MySQL server has gone away
誰(shuí)能解釋一下我做錯(cuò)了什么?
Can anyone please explain what I did wrong?
推薦答案
這不是 Laravel 的問(wèn)題,而是一個(gè)普遍的 MySQL 問(wèn)題.可能服務(wù)器沒(méi)有運(yùn)行.你確定你在后臺(tái)運(yùn)行 MySQL 嗎?
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?
檢查這個(gè)鏈接:MySQL消失了
在您的系統(tǒng)中執(zhí)行以下檢查:
Do the following checks in your system:
- 數(shù)據(jù)庫(kù)引擎正在運(yùn)行
- 您已經(jīng)創(chuàng)建了數(shù)據(jù)庫(kù)
- 您已創(chuàng)建用戶(hù)并授予數(shù)據(jù)庫(kù)權(quán)限
- 您已經(jīng)在 Laravel 的 .env 文件中設(shè)置了用戶(hù)和數(shù)據(jù)庫(kù).
此后,再次嘗試運(yùn)行遷移命令,即:
After this, try to run the migrations command again, which is:
php artisan migrate
如此處所述
讓我們知道這是否有幫助:).
Let us know if that helps :).
這篇關(guān)于mysql 服務(wù)器在安裝遷移過(guò)程中消失了錯(cuò)誤 (laravel)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!