Mysql is not recognized as an internal or external command, operable program or batch file laravel

I did set the MySQL path, but still, I'm getting the same error. Please let me know whether I followed it correctly or not.

MySQL location is: C:\Program Files\MySQL\MySQL Server 5.0\bin

In Windows, in the system variables, I had set the path as:

  • variable name: MYSQL_HOME
  • variable value: C:\Program Files\MySQL\MySQL Server 5.0\bin

For PATH setting:

  • variable name: PATH
  • variable value: .;%JAVA_HOME%\bin;%MYSQL_HOME%\bin...

If it is not correct, please let me know the correct path and its settings.

One of the most popular question I get after watching my MySQL courses on Pluralsight is that beginning users are not able to find where they have installed MySQL Server.

The error they receive is as follows when they type mysqld command on their default command line.

mysql‘ is not recognized as an internal or external command, operable program or batch file.

This error comes up if user try to execute mysqld command on default command prompt. The user should execute this command where mysql.exe file exists.  If you are using Windows Explorer you can easily search on your drive mysqld.exe and find the location of the file and execute the above command there. However, if you want to find out with command prompt the location of mysqld.exe file you can follow the direction here.

Step 1: Open a command prompt

Open command prompt from Start >> Run >> cmd >> enter

Mysql is not recognized as an internal or external command, operable program or batch file laravel

Step 2: Change directory

You need to change the default directory to root directory, hence type cd\ command on the prompt to change the default directory to c:\ . Here we are assuming that you have installed MySQL on your c: drive. If you have installed it on any other drive change the drive to that letter.

Mysql is not recognized as an internal or external command, operable program or batch file laravel

Step 3: Search Drive

Type the command dir mysqld.exe /s /p on the command prompt.

It will search your directories and will list the directory where mysqld.exe is located.

Mysql is not recognized as an internal or external command, operable program or batch file laravel

Step 4: Change Directory

Now once again change your command prompt file location to the folder where your mysqld.exe is located. In my case it is located here in folder C:\Program Files\MySQL\MySQL Server 5.6\bin hence I will run following command: cd C:\Program Files\MySQL\MySQL Server 5.6\bin .

Mysql is not recognized as an internal or external command, operable program or batch file laravel

Step 5: Execute mysqld.exe

Now you can once again mysqld.exe on your command prompt.

Mysql is not recognized as an internal or external command, operable program or batch file laravel

You can use this method to search pretty much any file with the help of command prompt.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Related Posts

How do you fix MySQL is not recognized as an internal or external command?

Fix MySQL not recognized error using Windows Graphical UI.
Click on Properties from My Computer or This PC screen. ... .
Click Advanced system settings from Properties. ... .
Click on Environment Variables from System Properties. ... .
Edit the Path variable from Environment Variables window..

Where can I find MySQL exe?

The mysql.exe resides in the MySQL\MySQL Server 5.7\bin directory. But the path to MySQL directory depends upon the architecture of the application. If you have installed x64 version then it should be in C:\Program Files\ . Otherwise, it should be in C:\Program Files (x86) .

Why MySQL command line is not opening?

Open Command prompt in admin and go to the location of Mysql bin folder and type - C:\ProgramFile\mysql\bin>mysql -u root -p <password> 2. Then the prompt asks for the password. This is the password or the root user which you had set during installation of mysql.

How do I know if MySQL is installed CMD?

The command prompt should change to mysql> letting you know you're currently in the MySQL folder. This lists the contents of the current folder. One of the folders will display the version number of your MySQL installation. For example, if you've installed MySQL 5.5, you should see a folder named “MySQL Server 5.5”.