recovery password MariaDB

This is step by step if you lost your root password mariadb, just follow step bellow :

Log into your GNU/Linux system as the user used by MySQL (usually ‘mysql’) or root.

Stop MariaDB and start again with the grant tables disabled:

# mysqld_safe --skip-grant-tables --skip-networking

  mysqld_safe will shut down mysqld for you.
  With --skip-grant-tables, no password is needed to logon.
  This is unsafe, so until the password is reset MariaDB should not accept network connections (--skip-networking).

Logon with no password:

# mysql -u root

Set your new password.

   Exec these 2 SQL statements and exit the client:

   --change pwd
   MariaDB> UPDATE `mysql`.`user`
	SET `Password` = PASSWORD('new_password')
	WHERE `User` = 'root';
   --tell the server to read the grant tables

(replace ‘new_password’ with the new password)

Stop mysqld_safe and start mysqld:

# /etc/init.d/mysql stop
# /etc/init.d/mysql start

Logon to mysql with new-password was you set before

hope this article help fully


souurce :


2 thoughts on “recovery password MariaDB

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.