---
title: Fixing a MariaDB database that has a corrupted root user password.
date: 2020-01-14T11:42:00-05:00
author: John Morton
canonical_url: "https://supergeekery.com/blog/fixing-a-mariadb-database-that-has-a-corrupted-root-user-password"
section: Blog
---
# Fixing a MariaDB database that has a corrupted root user password.

*January 14, 2020* by John Morton

In one terminal window I did this:

```
echo $(brew --prefix MariaDB)
```

That gave me the path to my MariaDB of: `/usr/local/opt/mariadb`

Then I ran this in that same window:

```
/usr/local/opt/mariadb/mysqld_safe
```

That started MariaDB successfully.

Then I opened a *2nd* terminal window.

```
sudo $(brew --prefix mariadb)/bin/mysqladmin -u root password
```

I followed the prompts to reset the password to '', i.e. blank.

Then I killed the MariaDB current running by entering (in the same window I just reset the password in)

```
pkill mysqld
```

That stopped the Mariadb that was running.

Then back in the 1st window, i started Mariadb as I normally would:

```
mysql.server start
```

Then I was able to successfully log into root via

```
mysql -uroot
```

That was more painful that it seems.
