MySQL Database server uses different tools and commands. The mysql command is one of them and one of the most important and popular commands. the mysql command is used to connect local or remote MySQL server. The “mysql command not found” is an error when the mysql command can not be executed in the command line interface. This error may occur in operating systems like Windows, Linux (Debian, Ubuntu, Centos, etc.), and MacOSX. There are different reasons for these errors and different solutions related to errors. In this tutorial, we will learn how to solve the “mysql command not found” error and provide different solutions.
“mysql command not found” Error
There are different reasons for the “mysql command not found” error. Below you can see this error in Windows operating system. The error message is a bit different from Linux and MacOS. The windows error message for MySQL is like below.
'mysql' is not recognized as an internal or external command, operable program or batch file.
“mysql command not found” Error Causes
The “mysql command not found” or “mysql is not recognized as internal or external command…” error can be caused by different reasons. Below we will list the reasons for these errors.
- The mysql or mysql client tools are not installed.
- The mysql binary or installatin path is not set properly via the path variable.
Install MySQL Client Tools In Windows
The MySQL client tools are provided via the following link. Just select the Microsoft Windows as the operating system and download the installer.
Install MySQL Client Tools In Linux
The MySQL client tools provide useful tools to administrate MySQL server. The mysql is one of them and should be installed on the local system in order to use it. The mysql command can be installed with the MySQL Server package or MySQL Server Client package.
Ubuntu, Debian, Mint, Kali:
sudo apt install mysql-client
Fedora, CentOS, RHEL:
sudo dnf install mysql-client
Install MySQL Client Tools In MacOSX
The mysql command is provided with the MYSQL Workbench for the MacOSX operating system. So in order to use the mysql command the MySQL Workbench should be installed. The MySQL Workbench can be installed from the following link.