Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
c:\xampp\mysql\bin\mysql.exe -u openaudit -popenauditpassword openaudit < c:\temp\openaudit_mysql.sql


Moving the Database Files on Windows

Sometimes users don't want the actual MySQL data on their C Drive. An example of moving the files to G Drive is below. Note - the MySQL server itself is left on C Drive, only the database data files are moved.

First, open a command prompt with Administrator rights, then run the below commands.

Code Block
net stop mysql
xcopy C:\xampp\mysql\data G:\data /O /X /E /H /K
move C:\xampp\mysql\data C:\xampp\mysql\data.bak
mklink /J C:\xampp\mysql\data G:\data
net start mysql

NOTE - We have not deleted the files in the original c:\xampp\mysql\data directory. This is left to the user to do when they are happy the files (now on G Drive) are working as intended.

To reverse the procedure (assuming you still have your original files in c:\xampp\mysql\data.bak, again open a command prompt with Administrator rights, then run the below commands.

Code Block
net stop mysql
rmdir c:\xampp\mysql\data
move c:\xampp\mysql\data.bak c:\xampp\mysql\data
net start mysql

NOTE - the actual data in g:\data has not been deleted and is left for the user to do.