0

I get this type of exception in all my Laravel projects.

Illuminate\Database\QueryException 

  SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = orchid and table_name = migrations and table_type = 'BASE TABLE')

  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| 

      +34 vendor frames 
  35  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

I tried to solve it through .env setup.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=orchid
DB_USERNAME=root
DB_PASSWORD=password

But it's not working.

After then I installed composer require doctrine/dbal package in my Laravel project but it's not working. I cannot understand how to solve it.

8
  • I think this problem comes from mysql server. But where exactly problem cannot find out the proper solution on it. So please help for this problem. Commented Jun 1, 2020 at 6:27
  • remove the password and leave it as blank Commented Jun 1, 2020 at 6:34
  • Thanks for your advise. But MySQL server have default password is password. without password it is not worked. Commented Jun 1, 2020 at 6:39
  • Okay got you. Then do try php artisan config:cache command to clear the cache and then try. Hopefully it'll work Commented Jun 1, 2020 at 6:40
  • I also trying this. but it's not working. May be this problem comes from mysql server. other wise comes from MACOS new version. this problem comes from new project also. Commented Jun 1, 2020 at 6:43

1 Answer 1

1

I try this solution. It helps me.

  1. Log in as root to mysql
  2. Run this sql command: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.