'Mysql' is not an internal or external command, nor is it a solution for running programs or batch processing files

Source: Internet
Author: User
Original article address:'Mysql' is not an internal or external command, nor is it a solution for running programs or batch processing files Author:Yan peifeng

'Mysql' It is not an internal or external command, nor a workable program or batch file solution

 

At noon today, I changed a new system and reinstalled wamp2.0. In the afternoon, I want to import a database file, open DOS, and input mysql-u root-P mydb2 <E: mysqlmydb2. SQL. In this case, 'mysql' is not an internal or external command, it is not a running program or batch processing file.

I checked it online, saying that the MySQL path was not added in the environment variable path.

On Windows, you need to add the MySQL path to the environment variable:

1. right-click "my computer"-"properties"-"advanced"-"environment variable"-"system variable"-double-click "path"-change the MySQL path "D: wampbinmysqlmysql5.0.51bbin (assume that your MySQL directory is the same as what I installed here. In fact, you can write the full path to your MySQL installation directory after finding the bin directory) "Add in-" OK"

2. After adding the package, test it in DOS:

C:> mysql-u root-P
Enter Password :**********
Welcome to the MySQL monitor. commands end with; or G.
Your MySQL connection ID is 21
Server version: 5.0.45-Community-nt MySQL Community edition (GPL)
Type 'help; 'or 'H' for help. Type 'C' to clear the buffer.
Mysql>
Mysql> is successful!

You can directly run MySQL server instance config wizard without using the above method. Simple operations are not described in detail.

There are other possibilities on the Internet, but I haven't met them here. I think it is best to remember it for future reference.

I. First

Symptom:

Enter cmd in the running state, and then input ipconfig in DOS, and press enter to display it:
C: documents and settingsadministrator> ipconfig (the same is true for other commands)
'Net' is not an internal or external command, or a program or batch file that can be run. This is because the path of the system environment variable has been changed and can be recovered.

 

Solution:

Right-click my computer and choose Properties> advanced> environment variables> system variables> path. Click Edit. Add "C: windowssystem32133" in the "variable value" dialog box. This is the path of cmd.exe, and click OK.
The reason is that the system has installed ImageMagick, gimp, MySQL, Java, and other software that can run dos. However, MySQL does not change the environment variables. If you want other software to continue running dos, you only need to add a path to the variable value. Use a semicolon between each path";"Separated, the order does not matter, and anyone before and after can.

Ii. Second

Add and run the MySQL path. No solution. Then, enter Net start MySQL and the Net start MySQL is started. The system error 5 is prompted. access is denied!

I checked again. It turns out that DOS was not started as an administrator. Then, start as an administrator based on the method provided on the Internet. It is solved. Both problems are solved.

 

The following describes how to start dos as an administrator.

1. In the search box of the Start menu, right-click and select Run as administrator!

If MySQL is to be started every day, isn't it very troublesome? Therefore:

2. Right-click CMD and select "attach to [start] menu (u)". This is where you can find cmd on the Start Menu,

3. Right-click "select Properties", select "shortcut", select "advanced", run as administrator, and click "OK!

In the future, you only need to open the Start menu and click the shortcut above to run cmd as an administrator!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.