0

I have installed MariaDB via Homebrew after following this guide. It has been working fine, however today the root password has expired and I cannot seem to reset it with any of the —skip-grant-tables —skip-networking type options.

So far I have tried:

brew services stop mariadb
mysqld_safe --skip-grant-tables --skip-networking
mysql_secure_installation

also tried

mysql_secure_installation --connect-expired-password

Which gives me:

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
/usr/local/Cellar/mariadb/10.3.13_1/bin/mysql: unknown option '--connect-expired-password'
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
/usr/local/Cellar/mariadb/10.3.13_1/bin/mysql: unknown option '--connect-expired-password'
Password update failed!
Cleaning up...

I've also added:

[mysqld]
default_password_lifetime=0
skip-grant-tables

to /usr/local/etc/my.cnf

Still doesn't let me update the root password with the above commands. Brew doctor comes back clean and I'm running out of things to try.

Alexander Holsgrove
  • 1,795
  • 3
  • 25
  • 54

2 Answers2

0

Ended up running /usr/local/mysql/bin/mysqladmin -u root -p password and set a new password.

Alexander Holsgrove
  • 1,795
  • 3
  • 25
  • 54
0

Log in

mysql -uroot

Then do

set password = password("your_password");
Michal Dolnik
  • 111
  • 1
  • 10
  • Your answer doesn't fit at all with the answer .... `ERROR 1698 (28000): Access denied for user 'root'@'localhost'` – jibeeeee Jul 06 '22 at 15:50