MySQL – How to Find mysqld.exe with Command Prompt – Fix: ‘mysql’ is not recognized as an internal or external command, operable program or batch file

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

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.

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.

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 .

Step 5: Execute mysqld.exe

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

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

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

About these ads

4 thoughts on “MySQL – How to Find mysqld.exe with Command Prompt – Fix: ‘mysql’ is not recognized as an internal or external command, operable program or batch file

    • that suppose that someone knows where mysql is.. here is trying to help people who do not know where is mysql on their machine…

  1. Hi Pinal, I think we can also set the full bin path in PATH system variables. So that everytime we open the command prompt it will be set and mysqld will be available.
    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s