MySQL 8 use mysql_native_password

Create a user with a native password in MySQL 8

CREATE USER 'nativeuser'@'localhost'IDENTIFIED WITH mysql_native_password BY 'password';

Configure mysql server globally by adding this line in your my.cnf file:

[mysqld]
default-authentication-plugin=mysql_native_password