We have a database and some data is stored in a Trucrypt folder, my question is how can I include this trucrypt folder. The data type is MyISAM. I saw there is a symbolic link, but not really clear for me how can I use that.
You could create a MyISAM and specify on-the-fly what the data directory and index directory are. The symlinks are made by mysqld.
According to MySQL Documentation, you can run CREATE TABLE with a DATA_DIRECTORY and INDEX_DIRECTORY option (not available for Windows).
For example, if you run this command
here is what you get
The advantage of doing this is to reduce disk I/O by having data and index files operate on different disks if you choose such mount points for the directories.
If you have data already established, you will have to do the following
If that fails, do this:
As a potential shortcut you could do this:
Give it a Try !!!
You can use symbolic links with MySQL. All you would need to do is make a symbolic link for the .frm, .MYI and .MYD files of your MyISAM tables into the MySQL database schema directory that you want. After that, run
It is also important that the MySQL user is able to access those files, so you might have a bit of an issue with user rights.
Also, depending on your MySQL version, there maybe a setting in the my.cnf which enables/disables symbolic links, so you would need to keep an eye on that too.
It is recommended to symlink the entire database, rather than specific tables - see section 126.96.36.199 of the MySQL 5.5 manual.
Section 188.8.131.52.2 states that it is possible to symlink the MyISAM data and index files to different directories (on different partitions for performance reasons), but NOT the .FRM table definition file.
You also need to ensure that you don't have "skip-symbolic-links" turned on in the server variables.
You can move existing data and index files (or a whole database) and then symlink back, just make sure you shut down the server first! If it doesn't start back up properly, check the "skip-symbolic-links" option has NOT BEEN SET...