Windows – How to save a MySQL database on another drive

MySQLwindows

In my app, I use MySQL for the database backend (the app uses multiple MySQL databases, all use MyISAM tables). For performance reasons, I want to move one of the databases to a solid state drive (DRAM based), but only that database, the other databases should stay on the SATA drive I use. As you know, in MySQL you can only specify the data directory in MySQL settings and you don't have control over where every database is saved. Is there any workaround for this? I'm hoping that there might some trick I'm not aware of that can get the job done.

Any suggestions would be really appreciated, thanks

Best Answer

Assuming your SSD has the drive letter G:\ you move your specific database subdirectory to the new drive and create a symlink in the 'datadir' directory.

mklink /D database_subdir G:\path\to\database

Best wishes, Fabian