How to resolve the issue if MySQL is not recognized as an internal or external command

If you encounter the error message “mysql is not recognized as an internal or external command” when entering the “mysql” command at the command prompt, it usually means that MySQL is not installed correctly on your computer or the executable file path of MySQL has not been added to the system’s environment variables. The solution is as follows:

  1. Make sure you have successfully installed MySQL. If you haven’t installed MySQL yet, please visit the official MySQL website (https://dev.mysql.com/downloads/) to download and install the latest version of MySQL.
  2. Check the installation path of MySQL. The executable files of MySQL are typically located in the bin folder within the installation path. For example, if your MySQL installation path is C:\Program Files\MySQL\MySQL Server 8.0, then the executable file path of MySQL would be C:\Program Files\MySQL\MySQL Server 8.0\bin.
  3. Add the executable file path of MySQL to the system’s environment variables. Open the control panel, go to “System and Security” -> “System” -> “Advanced system settings” -> “Advanced” -> “Environment Variables”. In the “System variables” section, find the “Path” variable, double click to open the edit window, add the MySQL executable file path at the end of the variable value, separate multiple paths with a semicolon, and then click OK to save.
  4. Click OK to close all windows and reopen the Command Prompt window.

Now you should be able to use the “mysql” command in the command prompt.

广告
Closing in 10 seconds
bannerAds