4

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

9
  • 1
    put the folder that mysql is in into your PATH Commented Jun 12, 2015 at 22:09
  • Another solution would be running the command within the mysql's folder installation. Commented Jun 12, 2015 at 22:09
  • 1
    are you sure it is not already running in the background on port 3306. look at task mgr / services / MySQL56 Commented Jun 12, 2015 at 22:10
  • @twentylemon How do I do that? Commented Jun 12, 2015 at 22:12
  • 1
    just use a pack like xampp or something to install it. Much easier than installing configuring yourself. also note that you need a space between -u and root Commented Jun 12, 2015 at 22:13

1 Answer 1

7

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.