How do I move files from




So that I could automatically use mysql commands without setting the paths.

migrated from stackoverflow.com Aug 5 '10 at 7:37

This question came from our site for professional and enthusiast programmers.


It's better to set the path enivironment variable itself to include the MySQL bin directory, than to move its contents to another directory already in the path. You don't say which version of Windows you're using. On XP you want to

  1. From the desktop, right-click My Computer and click Properties.
  2. In the System Properties window, click on the Advanced tab.
  3. In the Advanced section, click the Environment Variables button.
  4. Finally, in the Environment Variables window (as shown below), highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown below.

Google for other versions of Windows (if it's not the same as above).


In general, moving files out of install directories is not the best idea as the upgrade/uninstall programs will not know where you've move them. It then becomes a burden on YOU to figure out the right course of action.

Better to adjust the PATH environment variable.


Use the PATH variable. A former employer used to set up their standard workstations to copy java.exe to windows\system32 to reduce help desk calls. It is a giant PITA to debug that a few months down the line and all of a sudden your upgrades don't seem to be working.

My personal approach is to nest the paths like so:

MY_SQL_5_HOME = C:\wamp\bin\mysql\mysql5.1.36\
MY_SQL_6_HOME = C:\wamp\bin\mysql\my-sql-6-path


Then if you want to switch between versions, you can swap the settings of MYSQL_HOME.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.