Change the database password
MySQL
If your database is running in a Docker container, log into it by running:
docker exec -it <container_id> bash
Enter the MySQL CLI by running:
mysql -u<root_mysql_user> -p<old_password>
To change the password for MySQL 5.7 and above, run:
mysql> SET PASSWORD FOR 'root' = PASSWORD('new_password');
mysql> FLUSH PRIVILEGES;
To change the password for older versions (before 5.7), run:
mysql> ALTER USER '<mysql_user>'@'localhost' IDENTIFIED BY '<mysql_password>';
mysql> FLUSH PRIVILEGES;