Set Up MySQL Environment Variables: Windows Guide
To set up the environment variables for MySQL, you can follow these steps:
- To access the system’s environment variables settings in Windows, right-click on “My Computer” or “This PC,” select “Properties,” then click on “Advanced System Settings,” and finally click on the “Environment Variables” button.
- Add the MySQL bin directory path to the Path variable: Locate the Path variable in the system variables, click on edit, and add the MySQL bin directory path to the variable value, for example: C:\mysql\bin. Make sure to separate the paths with a semicolon.
- Click on “OK” to save the changes and close the window.
- Open the Command Prompt (CMD) and type mysql -V. If the environment variables are configured successfully, it will display the version information of MySQL.
- After the environment variables are configured, you can directly use the command prompt to operate the MySQL database using the mysql command.