From the course: Red Hat Enterprise Linux 8 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Recover the MariaDB root password

Recover the MariaDB root password

From the course: Red Hat Enterprise Linux 8 Essential Training

Start my 1-month free trial

Recover the MariaDB root password

- [Instructor] On occasion, you may not remember your database root user password and need to reset it without having access to the old one. You need superuser privileges to do this, so not just anyone can reset the database root user password. First, we need to stop the MariaDB server. In our terminal type in sudo systemctl stop mariadb and hit Enter. Type in your password if prompted. Then we need to run the mysqld_safe server with a skip grant tables option. Type in sudo mysqld_safe --skip-grant-tables & and hit Enter. Then hit Enter again. Be sure to add the ampersand at the end, or it will tie up your terminal. The --skip-grant-tables option starts mysqld without authentication. Now log into mysql as a database root user without a password by typing in mysql -u root -p and hit Enter, and hit Enter again when prompted for a password. Now we'll reset the password the way we did in a previous video. We want to start by switching to the mysql database. Type in use mysql; and hit…

Contents