Comments - Installing MariaDB MSI Packages on Windows

7 years, 5 months ago Vladislav Vaintroub
This comment has the status of 'removed' and can only be seen by you.

How to move data directory after the installation (in case that e.g disk C:\ is getting full).

Unfortunately, this is impossible to do from the MSI (does not offer to change the DatabaseInstance location). Instead, you can do follow below recipe, Assume you want to move data from "C:\Program Files\MariaDB 5.5\data" to "D:\data"

you need to

  • stop the service
  • move the data directory to new location (preserving permissions)
  • create symbolic link from old location to new location
  • give service account (NetworkService) full permissions on symbolic link
  • start service again

A script below illustrates how to do it from the elevated command line. It uses robocopy to copy the files, mklink to create the directory link, icacls for setting permissions on link, and net to start/stop service

net stop mysql
robocopy "C:\Program Files\MariaDB 5.5\data" D:\data /MIR /SEC
mklink /d "C:\Program Files\MariaDB 5.5\data"  D:\data
icacls "C:\Program Files (x86)\MariaDB 5.5\data" /grant "NT AUTHORITY\NetworkService":F
net start mysql

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.