Can't run MySQL from command prompt

16.9k views Asked by At

I downloaded MySQL 5.6.25 for Windowsx64 and I tried to run the command

mysql -uroot -p

to start using MySQL but it says

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

Do I need to move MySQL to some other place? It is currently on the desktop.

EDIT: I downloaded Xampp but now when I run that same command I get this: enter image description here

1

There are 1 answers

0
BK435 On BEST ANSWER

You need to place mysql in your environment variable PATH in order to run it from the command prompt, if you are not in bin directory of mysql.

On windows 7 (should be similar for 8):

  1. go to control panel>system
  2. on left hand side you should see Advanced system settings>double click on that
  3. At bottom of system properties you should see Environment Variables
  4. scroll down in the bottom panel till you see PATH click on it
  5. then click EDIT button underneath>opens new window Edit system variables
  6. at the end add your path to your mysql installation bin folder like C:\mysql\mysql5.6.23\bin; (must separate by ;).

enter image description here