Afin de changer le mot de passe de root MySql après installation, veuillez procéder comme suit :

sudo mysql
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> UPDATE user SET plugin = 'mysql_native_password' WHERE User = 'root';
Query OK, 1 row affected (0,01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'droopy';
Query OK, 0 rows affected (0,01 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,01 sec)

mysql> exit;
Bye

Accueil > Linux > Développement > [Ubuntu 22] Mysql Root Password