Can't run MySQL from command prompt

自作多情 提交于 2019-12-11 04:01:59

问题


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:


回答1:


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 ;).



来源:https://stackoverflow.com/questions/30812866/cant-run-mysql-from-command-prompt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!