mysql服务器在安装迁移过程中消失了错误(laravel) [英] mysql server has gone away error during installing migration (laravel)
问题描述
因此,我在laravel文件夹中使用了cmd,然后尝试这样做(php artisan migration: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
谁能解释我做错了吗?
推荐答案
这不是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文件中设置了用户和数据库.
此后,请尝试再次运行migrations命令,即:
After this, try to run the migrations command again, which is:
php artisan migrate
让我们知道是否有帮助:).
Let us know if that helps :).
这篇关于mysql服务器在安装迁移过程中消失了错误(laravel)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!