The error -bash: mysql: command not found means your shell cannot locate a MySQL client binary in the directories listed in the PATH environment variable. This is not a MySQL server problem unless you also cannot connect to a running server. This guide explains how to diagnose whether MySQL client tools are installed, how to find them if they exist, and how to add them to PATH so the shell can start the client.
What the error means at a high level
-bash: mysql: command not found is a shell message, not a MySQL server message. The shell searches each directory in PATH for an executable file named mysql. If none matches and no valid mysql binary is found, Bash reports command not found. Common causes include a missing MySQL client package, an incomplete install, or a correct install placed in a directory not in PATH. Note: this is distinct from access denied errors or connection failures, which indicate a client-server communication issue after the client is found.
Verify whether MySQL client is installed
Before changing PATH, confirm whether a MySQL client is present and where binaries may reside. Use system package tools and filesystem searches to verify install status.
Check package manager state
On Debian and Ubuntu, check if the mysql-client package is installed:
dpkg -l | grep mysql-clientOn RHEL, CentOS, and Fedora, check with:
rpm -qa | grep mysqlOn macOS with Homebrew, run:
brew list | grep mysql