[Solved] MySQL is not recognized as an internal or external command

Advertisement

Are you encountering the frustrating error message MySQL is not recognized as an internal or external command, operable program, or batch file?

Don’t worry; we’ve got you covered with a solution to resolve this issue and get your MySQL running smoothly.

You may sometimes see the error:

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

Something as in the below screenshot:

[Solved] MySQL is not recognized as an internal or external command 1
‘mysql’ is not recognized as an internal or external command, operable program, or batch file.

Here, The issue is the mysql.exe is not set up on your Windows Operating System.

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

MySQL is not recognized as an internal or external command.

We know that MySQL is a server-side scripting language.

But, Most of the time we face an issue:

[Solved] MySQL is not recognized as an internal or external command 3
[Solved] MySQL is not recognized as an internal or external command 14

Follow the below steps to solve the MySQL is not an internal or external command

Step 1: Open System Properties Step 1: Open System Properties

  • Click on the Start menu from Windows Operating System
  • Search for Environment Variables
  • Then click on Environment Variables

You will see something below

[Solved] MySQL is not recognized as an internal or external command 4
System Properties

Top ↑

Step 2: Add System Variables Step 2: Add System Variables

You add the MySQL file path in either the System variables or User Variables

  • System variables – If we add a path in system variables, other system users also use MySQL through the command line.
  • User variables – If we set the path for the current user then only the current user can execute the MySQL through the command line.

You can add the PATH as per your requirement.

[Solved] MySQL is not recognized as an internal or external command 6
Environment Variables and System Variables

Top ↑

Step 3: Add MySQL.exe File Path Step 3: Add MySQL.exe File Path

I have an Xampp, but somehow the environment variable is not working.

You may have a different place for the mysql.exe file.

You need to find it and set it in the Environment Variable Path as below:

[Solved] MySQL is not recognized as an internal or external command 8
C:\xampp\mysql\bin

Here, My mysql.exe file exists in the C:\xampp\mysql\bin directory.

So, I’m adding this path as:

[Solved] MySQL is not recognized as an internal or external command 9
System Properties Advanced

That’s it.

Top ↑

Done! MySQL is working now Done! MySQL is working now

To confirm that MySQL is now working just execute the below command:

mysql --version

E.g.

[Solved] MySQL is not recognized as an internal or external command 11
mysql –version

Top ↑

Frequently Asked Questions Frequently Asked Questions

What does the error “MySQL is not recognized as an internal or external command” mean? What does the error “MySQL is not recognized as an internal or external command” mean?

This error message typically means that your system is unable to find the MySQL executable file. This can occur for several reasons, such as if MySQL is not properly installed or if its installation directory is not added to the system’s PATH environment variable.

Top ↑

How can I check if MySQL is properly installed on my system? How can I check if MySQL is properly installed on my system?

You can check if MySQL is installed by running the following command in the command prompt:

mysql -u root -p

This command will attempt to connect to the MySQL server using the root user and prompt you for a password. If MySQL is properly installed, you should be able to access the MySQL prompt.

Top ↑

You may also like similar articles You may also like similar articles

Below are some articles which are similar to the above.

Top ↑

Read more MySQL articles Read more MySQL articles

Also, see some other MySQL how-to articles:

Leave a Reply