SuperGeekery: A blog probably of interest only to nerds by John F Morton.

A blog prob­a­bly of inter­est only to nerds by John F Mor­ton.

Fixing a MariaDB database that has a corrupted root user password.

In one ter­mi­nal win­dow I did this:

echo $(brew --prefix MariaDB)

That gave me the path to my Mari­aDB of: /usr/local/opt/mariadb

Then I ran this in that same win­dow:

/usr/local/opt/mariadb/mysqld_safe

That start­ed Mari­aDB suc­cess­ful­ly.

Then I opened a 2nd ter­mi­nal win­dow.

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

I fol­lowed the prompts to reset the pass­word to ”, i.e. blank.

Then I killed the Mari­aDB cur­rent run­ning by enter­ing (in the same win­dow I just reset the pass­word in)

pkill mysqld

That stopped the Mari­adb that was run­ning.

Then back in the 1st win­dow, i start­ed Mari­adb as I nor­mal­ly would:

mysql.server start

Then I was able to suc­cess­ful­ly log into root via

mysql -uroot

That was more painful that it seems.