Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Migrations with MySQL 8.0.x #27742

Closed
thekiharani opened this issue Mar 2, 2019 · 11 comments
Closed

Laravel Migrations with MySQL 8.0.x #27742

thekiharani opened this issue Mar 2, 2019 · 11 comments

Comments

@thekiharani
Copy link

  • Laravel Version: 5.8.2
  • PHP Version: 7.3.2
  • Database Driver & Version: mysql 8.0.15

Description:

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

Steps To Reproduce:

  • Install mysql 8.0 and use the new recommended password authentication (leave the legacy option)
  • Create new laravel app
  • Configure db in .env file
  • Try to migrate
@ahinkle
Copy link
Contributor

ahinkle commented Mar 3, 2019

Duplicate of #23961.

@staudenmeir
Copy link
Contributor

This is a PHP issue, Laravel can't do anything to fix it: https://bugs.php.net/bug.php?id=76243

@swrshah1
Copy link

open mysql in the terminal (just type mysql)
Use the following command
ALTER USER 'username here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password here';
Leave the password empty if you don't want a password.
Use this user in your laravel env file for the MYSQL database.

@vitormicillo
Copy link

This is the best solution until PHP not fix this issue.

open mysql in the terminal (just type mysql)
Use the following command
ALTER USER 'username here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password here';
Leave the password empty if you don't want a password.
Use this user in your laravel env file for the MYSQL database.

@Janczur
Copy link

Janczur commented Jan 22, 2020

open mysql in the terminal (just type mysql)
Use the following command
ALTER USER 'username here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password here';
Leave the password empty if you don't want a password.
Use this user in your laravel env file for the MYSQL database.

Thank you very much, this solution worked in my case

@oleynikd
Copy link

Don't forget to update to PHP 7.4

@sousadgaspar
Copy link

open mysql in the terminal (just type mysql)
Use the following command
ALTER USER 'username here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password here';
Leave the password empty if you don't want a password.
Use this user in your laravel env file for the MYSQL database.

I was passing through the same issue. And the procedure above solved. Thank you very much @swrshah1

@ChrisBinK
Copy link

open mysql in the terminal (just type mysql)
Use the following command
ALTER USER 'username here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password here';
Leave the password empty if you don't want a password.
Use this user in your laravel env file for the MYSQL database.

Thanks you.

@HuyPham55
Copy link

open mysql in the terminal (just type mysql)
Use the following command
ALTER USER 'username here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password here';
Leave the password empty if you don't want a password.
Use this user in your laravel env file for the MYSQL database.

Thanks sir

@Fullstack-WEB-Blockchain-Developer

open mysql in the terminal (just type mysql)
Use the following command
ALTER USER 'username here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password here';
Leave the password empty if you don't want a password.
Use this user in your laravel env file for the MYSQL database.

Thank you very much, this solution worked in my case PHP7.3

@gopalrathod131
Copy link

Thanks!
Perfect solution for mysql 8.0,x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests