<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    374 MySQL Technical Reference for Version 4.0.3 5.6.1.1  Using Symbolic Links for Databases The way to symlink a database is to rst create a directory on some disk where you have free space and then create a symlink to it from the MySQL database directory. shell> mkdir /dr1/databases/test shell> ln -s /dr1/databases/test mysqld-datadir MySQL  doesn't  support  that  you  link  one  directory  to  multiple  databases.   Replacing  a database directory with a symbolic link will work ne as long as you don't make a symbolic link between databases. Suppose you have a database db1 under the MySQL data directory, and then make a symlink db2 that points to db1: shell> cd /path/to/datadir shell> ln -s db1 db2 Now,  for any table  tbl_a  in  db1,  there also appears to be a table  tbl_a  in  db2.   If one thread updates db1.tbl_a and another thread updates db2.tbl_a, there will be problems. If you really need this, you must change the following code in `mysys/mf_format.c': if (flag & 32 || (!lstat(to,&stat_buff) && S_ISLNK(stat_buff.st_mode))) to if (1) On Windows you can use internal symbolic links to directories by compiling MySQL with -DUSE_SYMDIR.   This  allows  you  to  put  di erent  databases  on  di erent  disks.   See  Sec- tion 2.6.2.5 [Windows symbolic links], page 117. 5.6.1.2  Using Symbolic Links for Tables Before MySQL 4.0 you should not symlink tables, if you are not very careful with them. The problem is that if you run ALTER TABLE, REPAIR TABLE or OPTIMIZE TABLE on a symlinked table, the symlinks will be removed and replaced by the original les.  This happens because the above command works by creating a temporary le in the database directory and when the command is complete, replace the original le with the temporary le. You should not symlink tables on systems that don't have a fully working realpath() call. (At least Linux and Solaris support realpath()) In MySQL 4.0 symlinks are only fully supported for MyISAM tables.  For other table types you will probably get strange problems when doing any of the above mentioned commands. The  handling  of  symbolic  links  in  MySQL  4.0  works  the  following  way  (this  is  mostly relevant only for MyISAM tables).    In the data directory you will always have the table de nition le and the data/index les.    You can symlink the index le and the data le to di erent directories independent of the other.    The  symlinking  can  be  done  from  the  operating  system  (if  mysqld  is  not  running) or with the INDEX/DATA DIRECTORY="path-to-dir" command in CREATE TABLE.  See Section 6.5.3 [CREATE TABLE], page 469.
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide