草庐IT

php - SQLSTATE[42000] : Syntax error or access violation: 1064 default character set utf8 collate utf8_unicode_ci' at line 1

coder 2023-10-10 原文

<分区>

我正在尝试将此代码迁移到 mysql 数据库中,但不断收到此错误消息。

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') default character set utf8 collate utf8_unicode_ci' at line 1

public function up()
    {
        Schema::create('user', function(Blueprint $table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password', 60);
            $table->rememberToken();
            $table->timestamps();
            $table->integer('projectId')->unsigned();
            $table->boolean('isStudent');
            $table->boolean('isCompany');
            $table->String('img');
        });

        Schema::create('user', function($table)
        {
            $table->foreign('projectId')->references('id')->on('project');

        });


    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('user');
    }
}

有关php - SQLSTATE[42000] : Syntax error or access violation: 1064 default character set utf8 collate utf8_unicode_ci' at line 1的更多相关文章

随机推荐