Home >Database >Mysql Tutorial >Learning mysql is not an internal command error solution
The error that mysql is not an internal command occurs because the bin directory path of mysql is not added to the environment variable
Solution:
Open the computer's environment variables, select system variables, open Path, and add the bin directory path of mysql to it
The example is as follows:
Not yet Before adding environment variables
Add environment variables
After adding the environment variable, restart mysql
Content expansion:
It turned out that I used visual tools to do it Calling the database, I suddenly found out using the command line today:
mysql' is not an internal or external command, nor is it an operable program or batch file.
After some tossing, I found out what was wrong, and I will share it with you
Note 1: First check whether the environment variable has been added to the path
My Computer->right-click->Properties->Advanced System Settings->Advanced->Environment Variables->OK->System Variables (S)->Path (then double-click)
Then create a new one and add the mysql installation path/bin path. For example, mine is C:\Program Files\MySQL\MySQL Server 5.5\bin Just add it and finally confirm
Remember to add the bin directory. I didn’t write this. I only added the installation directory, so I couldn’t find it.
Note 2: Be sure to run the command line as an administrator
The commonly used way to open the command line is the window key R key, but this does not mean running as an administrator.
How to open the command line as an administrator:
Method 1: This window in the lower right corner of the computer, then right-click ----->Search
Method 2: This window in the lower right corner of the computer, then right-click - ->Window PowerShell (Administrator)
After entering, enter mysql -u account -p password, and the following will appear and it will be done
Related learning recommendations:mysql video tutorial
The above is the detailed content of Learning mysql is not an internal command error solution. For more information, please follow other related articles on the PHP Chinese website!