I was asked to create a CRUD APP with Laravel and Mysql from a potential employer but I’m getting an error when I run: <pre>php artisan migrate</pre> I’ve read all links on the first page of Google and Duckduckgo already but I couldn’t find the answer to my problem.

The errors when I run php artisan migrate is:

Illuminate\Database\QueryException  : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = Laravel-tasks and table_name = migrations)

  at /Users/my_username/PHP/todo/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }

  Exception trace:

  1   PDOException::("PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]")

  2   PDO::__construct("mysql:host=;port=3306;dbname=Laravel-tasks", "root", "YGM4QV6kWnjz3uN!", [])

This is the command line I executed inside my project folder<pre>php artisan make:migration create_tasks_table</pre>

This is the code on the create_tasks_table.php:


use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTasksTable extends Migration
     * Run the migrations.
     * @return void
    public function up()
        Schema::create('tasks', function (Blueprint $table) {

     * Reverse the migrations.
     * @return void
    public function down()

The Database on the .env is:


Hoping for your experienced responses!


This post is also available on DEV.