On Windows, symbolic links can be used for database directories. This enables you to put a database directory at a different location (for example, on a different disk) by setting up a symbolic link to it. Use of database symlinks on Windows is similar to their use on Unix, although the procedure for setting up the link differs.
Suppose that you want to place the database directory for a
D:\data\mydb. To do this, create a
symbolic link in the MySQL data directory that points to
D:\data\mydb. However, before creating
the symbolic link, make sure that the
D:\data\mydb directory exists by creating
it if necessary. If you already have a database directory
mydb in the data directory, move it
D:\data. Otherwise, the symbolic link
will be ineffective. To avoid problems, make sure that the
server is not running when you move the database directory.
Windows Vista, Windows Server 2008, or newer have native symbolic link support, so you can create a symlink using the mklink command. This command requires administrative privileges.
Change location into the data directory:
C:\> cd \path\to\datadir
In the data directory, create a symlink named
mydbthat points to the location of the database directory:
C:\> mklink /d mydb D:\data\mydb
After this, all tables created in the database
mydb are created in