본문 바로가기

기타

[심볼릭 링크] 특정 DATABASE만 C드라이브(SSD)로 옮기기

활용 사례:  C 드라이브는 SSD, D드라이브는 HDD 사용 중, DATABASE 디렉토리를 D드라이브에 잡아 놓았다.

그 중 특정 DATABASE를 빠른 읽기처리가 필요했고, 그 부분만 SSD 옮긴 후 심볼링 링크를 걸어서 사용

===================================================================

 

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 database named mydb at 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 named mydb in the data directory, 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.

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.

  1. Change location into the data directory:

    C:\> cd \path\to\datadir
  2. In the data directory, create a symlink named mydb that 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 D:\data\mydb.

 

 

출처 : https://dev.mysql.com/doc/refman/5.7/en/windows-symbolic-links.html