当前位置:网站首页>CMD command enters MySQL times service name or command error (fool teaching)

CMD command enters MySQL times service name or command error (fool teaching)

2022-07-07 19:16:00 You can't drink coffee with a cold!

1. Mistakes encountered

When we want to use cmd command ( Whether you are running as an administrator or not, there are errors ) Window enter local MySQL, Or use
net start mysql Command to start MySQL, Or use mysql -u root -p Yes MySQL When operating , Always report the following errors :
Not an internal command Or is it Invalid service name
 Insert picture description here

2. The cause of the error

The most likely thing is to install it yourself MySQL I didn't configure the environment variables . Just reconfigure the variables

3. resolvent

3.1 Directly use the path to operate

Find the one you installed at that time MySQL The path of , find bin Catalog
 Insert picture description here
Get into bin Copy the path in the red box after the directory :
 Insert picture description here
open cmd Command window direct copy cd + This path , You can enter the account and password MySQL 了
 Insert picture description here

3.2 Configure environment variables

1. Right click on this PC on the desktop , Enter properties
 Insert picture description here
2. Enter the following page , Click Advanced System Settings
 Insert picture description here
3. Click environment variable  Insert picture description here
3. Double click in system variables Path
 Insert picture description here
4. First click New , And then 3.1 Add the directory inside
 Insert picture description here
5., Finally, click the confirmation below
 Insert picture description here

4. To verify again ( After configuring the environment variables )

Run as administrator cmd window , operation MySQL:
 Insert picture description here
Run as a non administrator cmd window , operation MySQL:
 Insert picture description here
It's over , I hope I can help you !

原网站

版权声明
本文为[You can't drink coffee with a cold!]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071701125526.html