Updating path openssl keeps using wrong path I had to downgrade openssl version for mysql. But when I ran openssl version I still got the wrong version. So I checked which openssl and I saw that it's using from anaconda:

(base) ➜  ~ which openssl
/opt/anaconda3/bin/openssl


But it needs to use:

(base) ➜  ~ ls /usr/local/Cellar/openssl
1.0.2t


So what I tried:

(base) ➜  ~ export PATH="/usr/local/Cellar/openssl/bin:$PATH"
(base) ➜  ~ source ~/.bash_profile
(base) ➜  ~ echo $PATH | tr ':' '\n'
/Library/Frameworks/Python.framework/Versions/3.8/bin
/Library/Frameworks/Python.framework/Versions/3.7/bin
/usr/local/Cellar/openssl/bin
/opt/anaconda3/bin
/opt/anaconda3/condabin
/Library/Frameworks/Python.framework/Versions/3.8/bin
/Library/Frameworks/Python.framework/Versions/3.7/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin


So as you can see, my path is updated correctly. But when I run again which openssl it still gives me openssl from anaconda, what am I doing wrong here?
/usr/local/Cellar/openssl/bin (which currently is in your PATH) doesn't exist. If you want to use openssl from Homebrew use /usr/local/opt/openssl/bin (which will always point to the latest version installed via Homebrew).

export PATH="/usr/local/opt/openssl/bin:$PATH“