MySQL: Reset MariaDB Root
If customer forgot their root password of MariaDB, you can easily reset it rightaway. However, make sure they only using LAMP stand alone and did not use any Plesk or cPenal control panel. Resetting root MariaDB of cPanel and cPanel will make some function not running properly.
Table of Contents
Stop any mysql process on the server
service mariadb stop
Check and see if the process mysql is vanished
ps aux | grep mysql
Kill the process (if any) first
kill -9 xxxx
Run mysqld safe instance
mysqld_safe --skip-grant-tables &
Reconnect the database from root user
mysql -u root
Now Reset root password db
use mysql;
update user SET PASSWORD=PASSWORD("your-password-here") WHERE USER='root';
flush privileges;
exit
Now stop all process and make sure no mysql process alive. Then we start database.
service mariadb start
Done.
