简体   繁体   中英

MySQL not found command line Windows

I am trying to use mysql from the command line. I am starting the command line using cmd and enter

mysql

but the command is not recognized. I added the MySQL Shell and Server to the path variables like this: 环境变量


But it still does not work. Any idea? Thank you very much.

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

open cmd as admin and change the directory to the above path

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

Then run this command

mysql -V

This should work在此处输入图像描述

To set an environment variable follow the steps provided in this link: https://docs.oracle.com/en/database/oracle/machine-learning/oml4r/1.5.1/oread/creating-and-modifying-environment-variables-on-windows.html#GUID-DD6F9982-60D5-48F6-8270-A27EC53807D0

Set %MYSQL_PATH% variable value as => C:\Program Files\MySQL\MySQL Server 8.0\bin

Then run this command

%MYSQL_PATH%\mysql -V

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM