https://community.hortonworks.com/questions/449/how-to-reset-ambari-admin-password.html
1) Postgres - As mentioned earlier
2) Mysql
Login as root user mysql -u root -p ( press enter, it will ask for password)
use mysql;
SET PASSWORD FOR ‘admin‘@‘localhost‘= PASSWORD(‘admin‘);
OR
UPDATE mysql.user SET Password=PASSWORD(‘admin‘) WHERE User=‘admin‘ AND Host=‘localhost‘;
localhost can be FQDN based on mysql setup
3) Oracle
Login as sys or system user
sqlplus sys as sysdba
alter user admin identified by ‘admin‘;