0

I get the following error message when I run the command "php artisan migration".

Illuminate\Database\QueryException  SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: create table `migrations` (`id` int unsigned not null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
     667▕         // If an exception occurs when attempting to run a query, we'll format the error
     668▕         // message to include the bindings with SQL, which will make this exception a
     669▕         // lot more helpful to the developer instead of just the database's errors.
     670▕         catch (Exception $e) {
   ➜ 671▕             throw new QueryException(
     672▕                 $query, $this->prepareBindings($bindings), $e
     673▕             );
     674▕         }
     675▕ 
 
       +29 vendor frames 
   30  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

I changed the host database, localhost to 127.0.0.1. And I executed the command "php artisan config:clear".

Here is my configuration in the .env file :

DB_CONNECTION=mysql
DB_HOST=127.0.0.1.
DB_PORT=3306
DB_DATABASE=new_reservation
DB_USERNAME=root
DB_PASSWORD=

I use MAMP on my Mac.

I use PHP version 7.3.22.

Thank you in advance for your help.

Zoli Szabó
  • 4,366
  • 1
  • 13
  • 19
Hermann
  • 21
  • 6

0 Answers0