8.9.6 Using Symbolic Links

8.9.6.1 Using Symbolic Links for Databases on Unix
8.9.6.2 Using Symbolic Links for MyISAM Tables on Unix
8.9.6.3 Using Symbolic Links for Databases on Windows

You can move databases or tables from the database directory to other locations and replace them with symbolic links to the new locations. You might want to do this, for example, to move a database to a file system with more free space or increase the speed of your system by spreading your tables to different disks.

The recommended way to do this is to symlink entire database directories to a different disk. Symlink MyISAM tables only as a last resort.

To determine the location of your data directory, use this statement:

SHOW VARIABLES LIKE 'datadir';