Featured image of post Fix the Missing mysql Command After Installing DBngin

Fix the Missing mysql Command After Installing DBngin

DBngin supports multiple MySQL versions but never adds them to PATH. Add one line to .bashrc pointing to the latest version to get the mysql command working.

DBngin lets you run multiple versions of MySQL, PostgreSQL, and Redis simultaneously. However, since it supports multiple versions, it doesn’t automatically add the mysql executable to your PATH. Running mysql directly in the terminal will result in a “command not found” error.

Add the Latest MySQL Version to PATH

Add the following to ~/.bashrc to automatically pick up the latest MySQL version’s path:

1
echo 'export PATH=`printf "%s"$'\''\n'\'' /Users/Shared/DBngin/mysql/* | sort -Vr | head -n1`/bin:$PATH' >> ~/.bashrc

After reopening the terminal, you can use the mysql command directly.