I got error running migration under priject I added into homestead?

20 Views Asked by At

I added new project with migration files into homestead and I added new database name :

databases:
   ...
    - ProjectName

ports:
    - send: 33060 # MySQL/MariaDB
    to: 3306

In .env I added all connect parameters:

After I entered vagrant bash I got error running migration:

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=33060 DB_DATABASE=ProjectName DB_USERNAME=root DB_PASSWORD=root

$ php artisan migrate

   Illuminate\Database\QueryException 

  SQLSTATE[HY000] [2002]  (SQL: select * from information_schema.tables where table_schema = ProjectName and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
    708▕         // If an exception occurs when attempting to run a query, we'll format the error
    709▕         // message to include the bindings with SQL, which will make this exception a
    710▕         // lot more helpful to the developer instead of just the database's errors.
    711▕         catch (Exception $e) {
  ➜ 712▕             throw new QueryException(
    713▕                 $query, $this->prepareBindings($bindings), $e
    714▕             );
    715▕         }
    716▕     }

      +33 vendor frames 
  34  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

I have a ProjectName database in my homestaead phpmyadmin. I copypasted migrations table from other project, but I still got this error... How to fix it ? I cleared cahch with command :

php artisan config:cache

Seems I have valid ports set. How can I check it additively ?

Thank you!

1

There are 1 best solutions below

0
mstdmstd On

I set invalid passport. Must be :

  DB_PASSWORD=secret