I can not execute my migrations to phpmyadmin with Laravel

1

I'm trying to execute the migrations and at the moment of executing the php artisan migrate command, it throws me this: (I have modified the error because now it throws me this one.)

  

[PDOException]     SQLSTATE [HY000] [1044] Access denied for user '' @ 'localhost' to database 'school'

     

migrate [--bench [BENCH]] [--database [DATABASE]] [--force] [--path [PATH]] [--package [PACKAGE]] [--pretend] [--seed ]

I do not understand what I should do, I have already configured these routes __"app/config/local/database.php"__ *, *__"app/config/database.php"__ but I do not understand this error.

This is my code from the .env file

APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_URL=http://localhost

DB_HOST=localhost
DB_DATABASE=colegio
DB_USERNAME=root
DB_PASSWORD=

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
    
asked by lina salazar 06.12.2018 в 02:54
source

2 answers

1

I think there are two issues that can be giving you problems:

  • The User with whom the connection is made does not have all the permissions, it would be good to try giving all the possible grants.
  • The connection may be wrong, try doing a small echo test to see if the fixed connection is working on the base.
  • answered by 06.12.2018 в 03:11
    0

    Execute the command:     php artisan config:cache

    Sometimes, when we modify our .env file, Laravel does not update it in our cache. Your error shows that no user was specified for your Database even when well specified.

    The php artisan config:cache command cleans the cache and sets a new one.

        
    answered by 06.12.2018 в 23:33