Using Symbolic Links for Databases on Windows
by satheeshkumar[ Edit ] 2012-09-20 11:28:41
Using Symbolic Links for Databases on Windows ,
On Windows, create a symbolic link to a MySQL database by creating a file in the data directory that contains the path to the destination directory. The file should be named db_name.sym, where db_name is the database name.
Suppose that the MySQL data directory is C:\mysql\data and you want to have database foo located at D:\data\foo. Set up a symlink using this procedure:
Make sure that the D:\data\foo directory exists by creating it if necessary. If you already have a database directory named foo in the data directory, you should move it to 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.
Create a text file C:\mysql\data\foo.sym that contains the path name D:\data\foo\.
Note:
The path name to the new database and tables should be absolute. If you specify a relative path, the location will be relative to the foo.sym file.
After this, all tables created in the database foo are created in D:\data\foo.