Laravel: SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost'

前端 未结 7 2076
北荒
北荒 2020-12-16 01:45

I just installed laravel and made a migration. But when i try to run it i get this error:

[PDOException]                                                              


        
7条回答
  •  [愿得一人]
    2020-12-16 02:04

    I figured it out :) Had to chance the .env file :)

    Is there any changes in the schemaes?

    Shouldn't this work:

    public function up()
    {
        // Create table with columns
        Schema::create('users', function($table) {
            $table->increments('id');
            $table->string('username');
            $table->string(Hash::make('password'));
            $table->string('firstname');
            $table->string('lastname');
            $table->string('email')
            $table->string('role');
            $table->timestamps();
        }); 
    
    }
    
    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        // Insert table to database
        Schema::drop('users');
    }
    

提交回复
热议问题