If you forget your root MariaDB password, don’t worry and be sad because it can be reset easily with this tutorial.
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 &
Reconnect to the MariaDB server with the MariaDB root account:
$ mysql -u root
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
Then restart MariaDB:
$ sudo systemctl start mariadb
Done, everything will be fine. Now you should be able to access again with new password we update before.
Robbi Nespu | Database, Linux, MariaDB, RDBMS
The postings on this site are my own and don't necessarily represent my employer’s positions, strategies or opinions.
©Robbi Nespu, 2021 — built with Jekyll + Lagom theme
Home |
Contact |
Archive |
Privacy policy
Discussion and feedback