Environment variables can be set at the command prompt. This is done to affect the current invocation of the command handler, or is set permanently to affect future invocations. To set variables permanently, you can set them in the startup file or use the interface provided by the system. You'll need to consult your command interpreter's documentation for specific details.
To specify a value for an environment variable, you need to use command processor-related syntax.
The command to set environment variables can be executed in the command prompt and takes effect immediately, but the settings will only be maintained during the user login. Once you log out, changes will be lost.
If the MySQL program is installed in the /usr/local/mysql/bin directory, and the user wants to call these programs easily, the value of the PATH environment variable can be set to include this directory.
Before trying to add MySQL to the Windows path, make sure MySQL is installed correctly.
Here are the steps to add MySQL to the path:
Step 1 - Locate the mysql.exe file. We found it at:
C:\Program Files\MySQL\MySQL Server 8.0\bin
Step 2 - Press "Start" and enter "Environment Variables". Click -
p>
Step 3 - Under Advanced, click Environment Variables-
Step 5 - Click "New" -
Add the same path and click "OK" -
C:\Program Files\MySQL\MySQL Server 8.0\bin
The new PATH value should be available to any new command shells that the user now opens. This will allow the user to invoke any MySQL executable program by typing its name from any directory on the system at a DOS prompt.
The above is the detailed content of Add MySQL to Windows path. For more information, please follow other related articles on the PHP Chinese website!