From the course: Linux System Engineer: Database Servers Using MariaDB

Unlock the full course today

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

Set the root database password

Set the root database password

From the course: Linux System Engineer: Database Servers Using MariaDB

Start my 1-month free trial

Set the root database password

- [Instructor] There are multiple ways of setting the initial root database user's password. The easiest might be to use the mysqladmin command. Be sure that you are not logged into MariaDB with MySQL. You need to be on the Linux command line for this exercise. To set the initial root database user's password, we'll use the mysqladmin command. Type in mysqladmin -u root password and then enter your desired password. I'm going to set mine to mysecurepassword and hit Enter. Now let's verify by trying to login with the old blank password. Type in mysql -u root -p and hit Enter. And then hit Enter again for the blank password. You should be denied. Now let's try our new password. Bring your line back again and hit Enter. Now enter your new password. If it worked, you should be able to login fine. Another way to set the password, if you are able to login currently, is to use SQL and update the MySQL table. You would login as you normally would and then show databases. Type in show…

Contents