Mysql Mariadb Cacti PW Reset
Resetting mysql/mariaDB passwords.
MySQL/MariaDB Root PW
To reset a forgotten root password on MySQL/MariaDB:
- Determine if it is mysql vs mariadb
mysql --version
- Stop the database
- MariaDB
systemctl stop mariadb
- MySQL
systemctl stop mysql
- Start the database manually, skipping grants and networking
mysqld_safe --skip-grant-tables --skip-networking &
- Login as root (should not be prompted)
mysql -u root
- Set new root password for the database
MariaDB [(none)]> update mysql.user set password=password('MyNewPass') where user='root';
- Flush privileges
MariaDB [(none)]> flush privileges;
- Exit the database
MariaDB [(none)]> exit
- Stop the database, using the newly set pw(prompted)
mysqladmin shutdown -u root -p
- Start the database server with normal settings
- MariaDB
systemctl start mariadb
- MySQL
systemctl start mysql
Cacti
Resetting the cacti local admin pw.
- Login to the cacti database
mysql -u root -p cacti
- Requires knowledge of the mysql root pw
- Set a new password for the cacti admin
MariaDB [cacti]> update user_auth set password=md5('newpasswordhere') where username='admin';