How to Reset MariaDB Root Password

How to Reset MariaDB Root Password

Written By
RHB
Rose Hosting Blog
Mar 12, 2026

In this blog post, we will show you how to reset the MariaDB root password. We reset the MariaDB root password primarily because we forgot it, need to enhance security by changing it from a default/weak one (or a randomly generated one we didn’t save), or after system changes like upgrades or migrations that might have altered credentials, allowing us to regain administrative control over our database. The process usually involves starting the server in a special mode that disables password checks (such as –skip-grant-tables), logging in as root without a password, and then issuing SQL commands to set a new, strong password.

Resetting the MariaDB root password is a straightforward process that takes less than 5 minutes. Let’s get started!

RHB

Rose Hosting Blog

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.