MySQL Error immediately after installing Anaconda

Immediately prior to installing Anaconda I could login to mysql via:

mysql -uroot -p

Then installed Anaconda, following the directions on the install page. Downloaded the script, ran the script.

After that, I could no longer log into mysql using:

mysql -uroot -p

The error returned is:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

I didn’t do anything other than installing Anaconda by downloading & running the script.

Any ideas why mysql ends up with this login error after installing Anaconda?

Edited to add:

Just on a hunch, I deactivated the conda base environment via:

conda deactivate

And now can login to mysql normally with the mysql command I listed above.

So, my question now is a bit more specific. Why does being in a conda python environment interfere with the mysql command?

Found a solution for what I needed.

First reinstalled and used miniconda instead. That took care of the mysql connection issues in the terminal.

Still received mysql connection issues in jupyter notebooks, though. Checked my mysql configs and found that jupyter was looking in the wrong location for mysql.sock.

I symlinked /tmp/mysql.sock to the correct location and that seems to have fixed things.

Took another look at Anaconda full install which is on my laptop. Anaconda full install appears to install mysql as well in anaconda3/bin/mysql. That probably had something to do with why my system mysql initially had connection issues, maybe Anaconda & Jupyter were looking at the “wrong” mysql.

Not digging further at this point, maybe sometime in the future if I need to.

Just wanted to update this thread with some possible solutions for anyone else in the future who may run into the same issues.