1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

PHP Artisan Migration - Access denied for user 'root'@'localhost'

Discussão em 'Outras Linguagens' iniciado por Arya Aji, Outubro 13, 2024 às 07:42.

  1. Arya Aji

    Arya Aji Guest

    I'm having a problem running 'php artisan migrate' command, this is the error I got

    SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (Connection: mysql, SQL: select table_name as `name`, (data_length + index_length) as `size`, table_comment as `comment`, engine as `engine`, table_collation as `collation` from information_schema.tables where table_schema = 'e-commerce-web-proto' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)

    at vendor\laravel\framework\src\Illuminate\Database\Connection.php:829
    825▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
    826▕ );
    827▕ }
    828▕
    ➜ 829▕ throw new QueryException(
    830▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
    831▕ );
    832▕ }
    833▕ }


    I already changed the Database name to match the one I use, also run the php artisan config:cache. any thing else i need to do?

    here is my env. file

    DB_CONNECTION=mysql
    DB_HOST=localhost
    DB_PORT=3306
    DB_DATABASE=e-commerce-web-proto
    DB_USERNAME=root
    DB_PASSWORD=


    and here is my database config

    'mysql' => [
    'driver' => 'mysql',
    'url' => env('DATABASE_URL'),
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),

    Continue reading...

Compartilhe esta Página