Let us understand how to get the MySQL path in the command prompt -
In order to facilitate calling the MySQL program, you can add the path name of the MySQL bin directory to the Windows system PATH environment variable.
This can be done using the steps mentioned below -
Make sure that MySQL is properly installed before trying to add MySQL to the Windows path.
Here are the steps to add MySQL to the path -
Step 1 - Locate the mysql.exe file. We find 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 at a DOS prompt in any directory on the system.
This means the user does not have to provide the path. This includes the server, mysql client, and all MySQL command-line utilities such as mysqladmin and mysqldump.
If the user is running multiple MySQL servers, the MySQL bin directory should not be added to the Windows PATH on the same machine.
The above is the detailed content of Get MySQL path in command prompt. For more information, please follow other related articles on the PHP Chinese website!