You are here

Reset MariaDB Galera Cluster root password

Hello,

I have searched a lot in web and found no proper answer. I had setup a MariaDB galera cluster and now I have forgot root password. Is there anyway to reset it? I have found how to reset mysql root password in web. Should I do same here or different? So far what I have found is below steps:

1. Stop the MySQL service.

service mysql stop
2. Start MySQL without password and permission checks.

mysqld_safe --skip-grant-tables &
3. Press [ENTER] again if your output is halted.

4. Connect to MySQL.

mysql -u root mysql
5. Run following commands to set a new password for root user. Substitute NEW_PASSWORD with your new password.

UPDATE user SET password=PASSWORD('NEW_PASSWORD') WHERE user='root';
FLUSH PRIVILEGES;
6. Restart the MySQL service.

service mysql restart

If anybody can help me to properly reset root password here.

Thanks

Taxonomy upgrade extras: 

Hi,

You have found the correct way to reset the root password. I would also recommend to include the host in the update statement.

UPDATE mysql.user SET password = PASSWORD('secret') WHERE user = 'root' and host = 'localhost';

cedriccomment

I forgot to mention, that you have to do this step on all the nodes of the cluster, since they do not receive the query over the galera replication.

cedriccomment

Thanks

pkhadkacomment