To change the MySQL/MariaDB root password, follow these steps:
-
Ensure that the MySQL/MariaDB server is running.
-
Open a new Linux terminal.
-
Use the mysqladmin command-line utility to alter the MySQL/MariaDB password, using the following syntax:
mysqladmin --user=root password "newpassword"
ORALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD("verysecret")