mysql -u root -p -e "ALTER USER 'app'@'localhost' IDENTIFIED BY 'newpass';"
Change a MySQL user password
Updates the password for the app account, taking effect immediately for new logins; existing sessions keep running. Use SET PASSWORD for the current user. The host part must match the account exactly.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.