How To Reset Your MySQL or MariaDB Root Password

Run the following command to edit the my.cnf configuration file of the MySQL database: