mysql: [ERROR] unknown variable 'default-authentication-plugin=mysql_native_password' When I installed MySQL 8.0, I selected sha256 password authentication method instead of legacy, When I tried to return to native password authentication it shows an error message:
mysql: [ERROR] unknown variable 'default-authentication-plugin=mysql_native_password'.
when I type (mysql -u root -p) command in Debian 10 Linux.
You need specify like this in my.cnf file :
Note: Make sure it is under [mysqld] section.
default_authentication_plugin=mysql_native_password

Keeping in mind only changing default_authentication_plugin won't allow user to login, because it will still use the old authentication plugin using which the user was create.
To change to the plugin to need to follow below steps :
Step1 : Instance must be enabled with the old plugin only using which the user is created. In your case the default plugin will sha256 password.
Step2 : Now re-create user with mysql_native_password plugin.
CREATE USER 'nativeuser'@'localhost'IDENTIFIED WITH mysql_native_password BY 'password'; 

Step3: Change my.cnf with new plugin &amp; restart instance.
default_authentication_plugin=mysql_native_password