Set Up MySQL Environment Variables: Windows Guide

To set up the environment variables for MySQL, you can follow these steps:

  1. 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.
  2. 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.
  3. Click on “OK” to save the changes and close the window.
  4. Open the Command Prompt (CMD) and type mysql -V. If the environment variables are configured successfully, it will display the version information of MySQL.
  5. After the environment variables are configured, you can directly use the command prompt to operate the MySQL database using the mysql command.
bannerAds