F*ck you MySQL n MariaDB developers!
You always change the way to change the root password. Inconsistent, f*ck you guys!!
Change root password Maria db version 10.6.7-MariaDB-2ubuntu1 Ubuntu 22.04
- login as root
sudo mysql
- run this SQL command
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURNEWPASSWORDHERE');
- then run
flush privileges;
- exit / logout
- try login with the new password you just set.
Change root password Maria db version 10.9.3-MariaDB-1:10.9.3+maria~ubu1804
- run this SQL command
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyN3wP4ssw0rd';