Linux: Conda overriding system apps (eg: mysql)

In order for Anaconda to work, it need to be prioritized in PATH. However, this has unexpected side-effects. I was trying to set-up MySQL on my Ubuntu machine but kept running into the infamous

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

A long time afterwards, I randomly noticed that mysql was actually being called from ~/anaconda3/bin. I disabled conda and could set up MySQL normally.

So, my question becomes: is it possible to deactivate the overriding of specific apps/packages from ~/anaconda3/bin? I want to keep both my Anaconda environment and mysql. I’ve run into a similar issue in the past when compiling a C++ project and had to rename the anaconda3 folder completely in order for the PATH to not be interfered with.

Help is appreciated.

Are you using the base environment? If you set up separate environments for each project, and only install tools like MySQL in the environments where you need them, then they won’t conflict with systemwide installs unless the environment is activated.

Yes, I am using the base environment. Good to know, so I can duplicate my base environment and then remove the mysql package?

@octanervoc,

Yes, that should be possible. If you don’t want so many packages in your base environment you could use Miniconda or Miniforge to install conda. More information here: Installing conda — conda 24.7.1 documentation