创建新的Laravel后,Laravel迁移卡住了

时间:2018-09-08 14:48:26

标签: php laravel

我的XAMPP

enter image description here

我的Phpmyadmin

enter image description here

我在.env的代码

enter image description here

我的php artisan迁移

enter image description here

我总是被困在那里。 我正在使用Laravel 5.6和PHP 7.2.9

应该注意的是,这个laravel项目是一个新项目,除了默认的迁移代码,我没有任何迁移。

enter image description here

2 个答案:

答案 0 :(得分:4)

您的xampp端口mysql是3306。而您的phpmyadmin是8012。为什么不同?可以尝试在.env中使用3306?

答案 1 :(得分:0)

现在创建任何Laravel项目时,我要做的第一件事就是指定默认的字符串长度。

我首先打开 AppServiceProvider.php ,然后执行以下操作:

    public function boot()
    {
       Schema::defaultStringLength(191);
    }

那么尝试一下,告诉我这是否解决了您的问题?