“php artisan migrate”仍处于暂停状态,不会导致错误

我使用该命令启动了一个新项目。laravel^6.2laravel new myapp


然后编辑我的文件以连接到我的本地数据库:.env


DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_PORT=8082

DB_DATABASE=laravel

DB_USERNAME=root

DB_PASSWORD=root

然后我决定从laravel默认数据库结构。当我说默认结构时,我说的是从文件开始就已经创建的迁移:migrateusers2014_10_12_000000_create_users_table.php


<?php


// *** This has been generated from `laravel new myapp` ***


use Illuminate\Database\Migrations\Migration;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Support\Facades\Schema;


class CreateUsersTable extends Migration

{

    /**

     * Run the migrations.

     *

     * @return void

     */

    public function up()

    {

        Schema::create('users', function (Blueprint $table) {

            $table->bigIncrements('id');

            $table->string('name');

            $table->string('email')->unique();

            $table->timestamp('email_verified_at')->nullable();

            $table->string('password');

            $table->rememberToken();

            $table->timestamps();

        });

    }


    /**

     * Reverse the migrations.

     *

     * @return void

     */

    public function down()

    {

        Schema::dropIfExists('users');

    }

}

所以我运行命令,然后发生了一些意想不到的事情。事实上,在那之后,终端不会做任何事情,就好像它正在休息一样。我想也许该命令需要一段时间才能执行,但是在持续了大约十分钟的几次尝试之后,没有任何反应。php artisan migrate


所以我决定查阅日志,但绝对没有写下任何东西,它完全是空的。


因此,我正在尝试执行并重新开始,但结果是相同的:没有错误消息,也没有发生任何事情。php artisan cache:clear


我知道这个问题以前在这里被问过,但没有真正提出答案。


有人知道我错过了什么吗?


慕工程0101907
浏览 122回答 1
1回答

暮色呼如

尝试将端口更改为默认的 MySQL 端口。3306端口听起来很不寻常,除非您在MySQL服务器中设置了该端口。8082从您的评论中:您的计算机上运行着多个“本地主机”服务器:您的本地主机Web服务器,端口80通常(在您的情况下为8082)您的本地主机mysql服务器,通常端口为3306。可能还有一个本地主机postgres服务器,在端口上运行(默认),在端口运行本地主机redis服务器或许多其他服务器。54326379
打开App,查看更多内容
随时随地看视频慕课网APP