MySql Cannot connect after installation I am new to MySQL. 

I installed MySQL through dmg file downloaded from oracle in mac. I created my first connection also but now whenever I am trying to connect it again it not allowing me. 

I read over internet that I need to ALTER root password. So I tried many ways of doing it but either it says UPDATE Command not found or Access denied to root@localhost...

Can someone please suggest a solution?
My issue got resolved using the information in URL below:

https://vladster.net/en/instructions/install-mysql-mac/

Steps taken:


Changed to MySQL directory:
cd /usr/local/mysql  
Since my initial root password was expired and was not able to connect to root, so ran the installation again:
sudo bin/mysql_secure_installation  
After providing machine password it automatically asked for new root password. 


Above steps resolved my issue.