PDF (A4) - 40.9Mb
Man Pages (TGZ) - 259.7Kb
Man Pages (Zip) - 366.9Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
Symbolic link support as described here, along with the--symbolic-links option that controls it, and is deprecated; expect these to be removed in a future version of MySQL. In addition, the option is disabled by default.
Symlinks are fully supported only forMyISAM tables. For files used by tables for other storage engines, you may get strange problems if you try to use symbolic links. ForInnoDB tables, use the alternative technique explained inSection 17.6.1.2, “Creating Tables Externally” instead.
Do not symlink tables on systems that do not have a fully operationalrealpath() call. (Linux and Solaris supportrealpath()). To determine whether your system supports symbolic links, check the value of thehave_symlink system variable using this statement:
SHOW VARIABLES LIKE 'have_symlink'; The handling of symbolic links forMyISAM tables works as follows:
In the data directory, you always have the data (
.MYD) file and the index (.MYI) file. The data file and index file can be moved elsewhere and replaced in the data directory by symlinks.You can symlink the data file and the index file independently to different directories.
To instruct a running MySQL server to perform the symlinking, use the
DATA DIRECTORYandINDEX DIRECTORYoptions toCREATE TABLE. SeeSection 15.1.21, “CREATE TABLE Statement”. Alternatively, ifmysqld is not running, symlinking can be accomplished manually usingln -s from the command line.NoteThe path used with either or both of the
DATA DIRECTORYandINDEX DIRECTORYoptions may not include the MySQLdatadirectory. (Bug #32167)myisamchk does not replace a symlink with the data file or index file. It works directly on the file to which the symlink points. Any temporary files are created in the directory where the data file or index file is located. The same is true for the
ALTER TABLE,OPTIMIZE TABLE, andREPAIR TABLEstatements.- Note
When you drop a table that is using symlinks,both the symlink and the file to which the symlink points are dropped. This is an extremely good reasonnot to runmysqld as the
rootoperating system user or permit operating system users to have write access to MySQL database directories. If you rename a table with
ALTER TABLE ... RENAMEorRENAME TABLEand you do not move the table to another database, the symlinks in the database directory are renamed to the new names and the data file and index file are renamed accordingly.If you use
ALTER TABLE ... RENAMEorRENAME TABLEto move a table to another database, the table is moved to the other database directory. If the table name changed, the symlinks in the new database directory are renamed to the new names and the data file and index file are renamed accordingly.If you are not using symlinks, startmysqld with the
--skip-symbolic-linksoption to ensure that no one can usemysqld to drop or rename a file outside of the data directory.
These table symlink operations are not supported:
ALTER TABLEignores theDATA DIRECTORYandINDEX DIRECTORYtable options.
PDF (A4) - 40.9Mb
Man Pages (TGZ) - 259.7Kb
Man Pages (Zip) - 366.9Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb