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

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.

This question is related to mysql mysql-error-1064

The answer is


MYSQL_HOME:

C:\Program Files\MySQL\MySQL Server 5.0

Path:

%MYSQL_HOME%\bin;

enter image description hereHere what I DO on MY PC I install all software that i usually used in G: partian not C: if my operating system is fall (win 10) , Do not need to reinstall them again and lost time , Then How windows work it update PATH automatic if you install any new programe or pice of softwore ,

SO

I must update PATH like these HERE! all my software i usually used 1- I created folder called Programe Files 2- I install all my programe data in these folder 3-and then going to PATH and add it Dont 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


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.


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


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.


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


Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to mysql-error-1064

How to grant all privileges to root user in MySQL 8.0 Warning about SSL connection when connecting to MySQL database How can I fix MySQL error #1064? MySQL Error #1133 - Can't find any matching row in the user table MySql Inner Join with WHERE clause Check for database connection, otherwise display message ERROR 1064 (42000) in MySQL mysql is not recognised as an internal or external command,operable program or batch MySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO