Using a configuration file for mysql is a good practice as you don't immediately expose credentials. Below, you are going to mysql cli and immediately using the db named dbName.
1mysql --defaults-file=/path/to/credentials.ini dbName where credentials.ini has this format:
For as long as you have root access to MySQL, this would work:
1UPDATE mysql.user SET Password=PASSWORD('new-password-here') WHERE USER='user-name-here' AND Host='host-name-here'; more details from https://www.cyberciti.biz/faq/mysql-change-user-password/