Follow these steps to reset your MySQL/MariaDB root password: Stop the MySQL/MariaDB service. Start the MySQL/MariaDB server without loading the grant tables. Log in to the MySQL shell. Set a new root password. Stop and Start the database server normally. Verify the password. Click to see full answer. Keeping this in consideration, how do I change the root password in MySQL? To reset the root password for MySQL, follow these steps: Log in to your account using SSH. Stop the MySQL server using the appropriate command for your Linux distribution: Restart the MySQL server with the —skip-grant-tables option. Log into MySQL using the following command: At the mysql> prompt, reset the password. Additionally, what is the default root password for MariaDB? The default password for Mariadb is blank. Similarly one may ask, how do I log into MariaDB as root? Root Login To log in to MariaDB as the root user: mysql -u root -p. When prompted, enter the root password you assigned when the mysql_secure_installation script was run. You’ll then be presented with a welcome header and the MariaDB prompt as shown below: To generate a list of commands for the MariaDB prompt, enter h . How do I find my MySQL root password? How to retrieve MySQL root password Log in as root into your server through SSH (eg: puTTY/terminal/bash). Alternatively, run the commands that follow as su or sudo as root user. Navigate to /etc/mysql/cd /etc/mysql. View the file my. cnf either using the command cat or use any text editing software (vi/vim/nano).