in This Tutorial you will learn " How To Recover Reset MySQL 8 admin / Root Password On Ubuntu 20.04"
MySQL is an open-source relational database management system.
Code -
lsb_release -d ; mysql -V
systemctl stop mysql
mkdir /var/run/mysqld ; chown mysql: /var/run/mysqld
mysqld_safe --skip-grant-tables --skip-networking &
mysql -uroot mysql
UPDATE mysql.user SET authentication_string=CONCAT('*', UPPER(SHA1(UNHEX(SHA1('yournewpassword'))))), plugin='mysql_native_password' WHERE User='root' AND Host='localhost';
\q;
mysqladmin -S /var/run/mysqld/mysqld.sock shutdown
systemctl restart mysql ; systemctl status mysql
mysql -u root -p