How to reset root MySQL/MariaDB password on Ubuntu 20.04 Focal Fossa Linux - LinuxConfig.org

In this guide we will reset the lost root MySQL/MariaDB password on Ubuntu 20.04 Focal Fossa. This can be achieved by disabling the root authentication and longing in without the password.
This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-reset-root-mysql-mariadb-password-on-ubuntu-20-04-focal-fossa-linux
1 Like

thank you very much!!!

Database changed
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'myweakpswd';
ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded

ERROR 1524 (HY000): Plugin ‘auth_socket’ is not loaded

try this:

use mysql;
update user set plugin=“mysql_native_password” where User=‘root’; # THIS LINE
flush privileges;