4,552,373 th visitor since 2017.2.1 ( Today : 146 )
Programming
No. 676
Name. swindler
Subject. window 에서 DB별로 디렉토리 분리하기
Main Cate. MySQL
Sub Cate.
Date. 2010-05-06 21:20
Hit. 3329 (115.137.68.113)
File.
7.6.1.3. Using Symbolic Links for Databases on Windows
Beginning with MySQL 3.23.16, the mysqld-max and mysql-max-nt servers for Windows are compiled with the -DUSE_SYMDIR option. This allows you to put a database directory on a different disk by setting up a symbolic link to it. This is similar to the way that symbolic links work on Unix, although the procedure for setting up the link is different.

As of MySQL 4.0, symbolic links are enabled by default. If you don't need them, you can disable them with the skip-symbolic-links option:

[mysqld]
skip-symbolic-links
Before MySQL 4.0, symbolic links are disabled by default. To enable them, you should put the following entry in your my.cnf or my.ini file:

[mysqld]
symbolic-links
On Windows, you make 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 like this:

1.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, the server should not be running when you move the database directory.

2.Create a file C:\mysql\data\foo.sym that contains the pathname D:\data\foo\.

After that, all tables created in the database foo will be created in D:\data\foo. Note that the symbolic link will not be used if a directory with the database name exists in the MySQL data directory.



ps. 이외에 윈도우에서 symbolic link를 지원해주는 프로그램도 있다. (junction 인가?)
그것도 잘 지원되는지 해보지 않아 모르겠으나 이 방법이 더 좋을듯.

[바로가기 링크] : http://coolx.net/cboard/develop/676



Name
Password
Comment
Copyright © 1999-2017, swindler. All rights reserved. 367,611 visitor ( 1999.1.8-2004.5.26 ), 2,405,771 ( -2017.01.31)

  2HLAB   2HLAB_Blog   RedToolBox   Omil   Omil_Blog