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