mysql is not recognised as an internal or external command,operable program or batch

MysqlMysql Error-1064

Mysql Problem Overview


I had set the MySQL path, but still getting the same error. Please let me know whether I followed the correct one or not.

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

In Windows, 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 the correct one, please let me know the correct path and its settings.

Mysql Solutions


Solution 1 - Mysql

Simply type in command prompt :

set path=%PATH%;D:\xampp\mysql\bin;

Here my path started from D so I used D: , you can use C: or E:

enter image description here

Solution 2 - Mysql

> MYSQL_HOME variable value=> C:\Program Files\MySQL\MySQL Server 5.0\bin

%MYSQL_HOME%\bin

See the problem? This resolves to a path of C:\Program Files\MySQL\MySQL Server 5.0\bin\bin

Solution 3 - Mysql

MYSQL_HOME:

C:\Program Files\MySQL\MySQL Server 5.0

Path:

%MYSQL_HOME%\bin;

Solution 4 - Mysql

enter image description here
Here is what I DO on my PC, I install all software that I usually used in G: partition not C: if my operating system is fall (win 10), Do not need to reinstall them again and lose time, Then How windows work it update PATH automatic if you install any new program or piece of software,

SO

I must update PATH like these HERE! all the software I usually used 1- I created a folder called Program Files 2- I install all my programs data in this folder 3-and then going to PATH and add it Don't forget ;

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;G:\HashiCorp\Vagrant\bin;G:\xampp\php;G:\xampp\mysql\bin;G:\Program Files (x86)\heroku\bin;G:\Program Files (x86)\Git\bin;G:\Program Files (x86)\composer;G:\Program Files (x86)\nodejs;G:\Program Files (x86)\Sublime Text 3;G:\Program Files (x86)\Microsoft VS Code\bin;G:\Program Files (x86)\cygwin64\bin

enter image description here

Solution 5 - Mysql

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

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

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

For User variable for user:

  • Click Path ---> NEW ---> C:\Program Files\MySQL\MySQL Server 8.0.25\bin

  • Click OK

  • Now check with cmd (mysql -V)

    You may get a command like this

    mysql  Ver 8.0.25 for Win64 on x86_64 (MySQL Community Server - GPL)
    

You're DONE.

Solution 6 - Mysql

I am using xampp. For me best option is to change environment variables. Environment variable changing window is shared by @Abu Bakr in this thread

I change the path value as C:\xampp\mysql\bin; and it is working nice

Solution 7 - Mysql

In my case, it turned out to be a simple case of spacing.

Turns out, i had a space inserted after the last ; and before ""C:\Program Files\MySQL\MySQL Server 5.7" For this very simple reason, no matter what i did, MySql was still not being recognized.

Once i eliminated the spaces before and after path, it worked perfectly.

In retrospect, seems like a very obvious answer, but nobody's mentioned it anywhere.

Also, i'm new to this whole windows thing, so please excuse me if it sounds very simple.

Solution 8 - Mysql

If you use wamp server add C:\wamp64\bin\mysql\mysql5.7.31\bin to environment variables PATH

Solution 9 - Mysql

To make it easier to invoke MySQL programs in CMD, you can add the path name of the MySQL bin directory to your Windows system PATH environment variable:

follow the below link.

https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/mysql-installation-windows-path.html

Solution 10 - Mysql

You only have to set path in the system variables and you are done with the job. Here I will show you step by step:

Step1: Go the start taskbar and write environment and click on the edit system environment option:

enter image description here

Step2: After clicking a dialog box namely System Properties Will occur like this:

enter image description here

Step3: Click on environment variables and then inside system variables in which there is written path, double click on path a new dialog box namely edit environment variables will be pop up as shown:

enter image description here

Then add the address of the MySql bin in windows C the path by clicking new path option, in my laptop MySql was here so added this path C:\Program Files\MySQL\MySQL Server 8.0\bin, thats it click ok and run on command prompt mysql --version command and it will show the actual version of mysql installed at your pc

Solution 11 - Mysql

In my case changing the directory to

cd C:\Program Files\MySQL\MySQL Server 8.0\bin

I have noticed no changes but when I wrote mysql

It ran perfectly

Solution 12 - Mysql

In my case, I resolved it by adding this path C:\xampp\mysql\bin to system variables path and then restarted pash/cmd.

Note: Click me if you don't know how to set the path and system variables.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionhariView Question on Stackoverflow
Solution 1 - MysqlPratikView Answer on Stackoverflow
Solution 2 - MysqlDavid FellsView Answer on Stackoverflow
Solution 3 - MysqlEmmanuel OsimosuView Answer on Stackoverflow
Solution 4 - MysqlAbubakr ElghazawyView Answer on Stackoverflow
Solution 5 - MysqlHazlitt VasudevanView Answer on Stackoverflow
Solution 6 - MysqlRajibView Answer on Stackoverflow
Solution 7 - MysqlSahasraView Answer on Stackoverflow
Solution 8 - MysqlSwaleh MatongwaView Answer on Stackoverflow
Solution 9 - MysqlsanujaView Answer on Stackoverflow
Solution 10 - MysqlAditi NegiView Answer on Stackoverflow
Solution 11 - MysqlAbdullah HabashyView Answer on Stackoverflow
Solution 12 - MysqlsaeeView Answer on Stackoverflow