mysql: ERROR 1524 (HY000): Plugin 'mysql-native-password' is not loaded
I just installed a fresh install of mysql-server-5.7 no linux mint 19.1.
I wasn't prompted to set a root password during the installation and so whenever I tried to use mysql via the mysql -u root -p command.
I got this error => Access denied for user 'root'@'localhost'.
So I searched stack overflow and found an answer that involved setting the authentication plugin to mysql_native_password. the query looked something like this...
UPDATE user SET plugin="mysql_native_password";However, for some reason I typed the command manually instead of copying it and I seem to have written mysql-native-password instead of mysql_native_password (stupid me!!!)
now I tried to access the mysql shell in various ways but I always get the following error!
ERROR 1524 (HY000): Plugin 'mysql-native-password' is not loadedI tried...
$sudo mysql -u root
$sudo mysql
$mysql -u root -p
$mysql_upgrade ...
$sudo mysql_secure_installationbut everything returned the same ERROR
HELP!!!
1 Answer
Hi I was in the same boat - I managed to fix the issue by uninstalling mySQL completely and running a fresh install. I used the following commands for the uninstallation:
sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
exitThen running a fresh install as per your operating system requirements (in my case Ubuntu):
sudo apt update
sudo apt install mysql-server 1