sudo mysql -u root ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_PASSWORD_HERE'; FLUSH PRIVILEGES; mysql -u root -p # and it works