Reset the MariaDB Root Password

If you forget your root MariaDB password, don’t worry and be sad because it can be reset easily with this tutorial.
  1. Stop the current MariaDB server instance, then restart it with an option to not ask for a password:
     $ sudo systemctl stop mariadb
     $ sudo mysqld_safe --skip-grant-tables &
    
  2. Reconnect to the MariaDB server with the MariaDB root account:
     $ mysql -u root
    
  3. Use the following commands to reset root’s password. Replace password with a strong password:
     use mysql;
     update user SET PASSWORD=PASSWORD("password") WHERE USER='root';
     flush privileges;
     exit
    
  4. Then restart MariaDB:
     $ sudo systemctl start mariadb
    
Done, everything will be fine. Now you should be able to access again with new

if you have the password and want to change then

simply log in with the root user then

use mysql;

update user SET PASSWORD=PASSWORD("password") WHERE USER='root';

systemctl restart mariadb


--------------

working

SET PASSWORD FOR 'techonthenet'@'localhost' = PASSWORD('newpassword');

Comments

Popular posts from this blog

cpanel exam CPSP Answers

How to install zimbra collaboration suite 8.8.11 on CentOS 7

awstats installation