mysql 服务器在安装迁移过程中消失了错误 (laravel) [英] mysql server has gone away error during installing migration (laravel)

查看:24
本文介绍了mysql 服务器在安装迁移过程中消失了错误 (laravel)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在我的 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:

    1. 数据库引擎正在运行
    2. 您已经创建了数据库
    3. 您已创建用户并授予数据库权限
    4. 您已经在 Laravel 的 .env 文件中设置了用户和数据库.

    此后,再次尝试运行迁移命令,即:

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

    php artisan migrate
    

    此处所述

    让我们知道这是否有帮助:).

    Let us know if that helps :).

    这篇关于mysql 服务器在安装迁移过程中消失了错误 (laravel)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆