List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:August 20 1999 3:45am
Subject:Re: Using symbolic links for databases and tables
View as plain text  
At 6:26 AM +0300 8/20/99, Jani Tolonen wrote:
>Marek Chlup writes:
> > I want use symbolic link for table. For examle:
> >
> > shell> cd /database_directory/DB2
> > shell> ln -s ../DB1/MY_TABLE.* ./
> >
> >
> > At MySQL Reference Manual I read:
> > ( 
>http://www.mysql.net/Manual_chapter/manual_Performance.html#Symbolic_l 
>inks )
> > ------------------
> > 10.9 Using symbolic links for databases and tables
> > ......
> > MySQL doesn't support linking of databases by default. Things 
>will work fine as long as you don't make a symbolic link between 
>databases.
> > ......
> > If you really need this, you must change the following code in 
>`mysys/mf_format.c':
> > if (!lstat(to,&stat_buff))  /* Check if it's a symbolic link */
> >     if (S_ISLNK(stat_buff.st_mode) && realpath(to,buff))
> > Change the code to this:
> > if (realpath(to,buff))
> > ------------------
> >
> >
> > But this code not in mysys/mf_format.c file. I find only this code:
> >   /* Purify gives a lot of UMR errors when using realpath */
> > #if defined(HAVE_REALPATH) && !defined(HAVE_purify)
> >   if (flag & 16)
> >   {
> >     struct stat stat_buff;
> >     if (flag & 32 || (!lstat(to,&stat_buff) &&
> S_ISLNK(stat_buff.st_mode)))
> >     {
> >       if (realpath(to,buff))
> >         strmov(to,buff);
> >     }
> >   }
> > #endif
> >
> >
> > I use Linux 2.0.35 and Mysql 3.22.24.
> > Please help me how can change this code for using "symbolic link on table".
>
>
>Hello Marek,
>
>You can use symbolic links at least on Solaris and Linux,
>so go ahead. No need to change the code, at least with
>the version of MySQL you are using.


What happens when you issue an ALTER TABLE or OPTIMIZE TABLE
on the symlinked table?

-- 
Paul DuBois, paul@stripped
Thread
Using symbolic links for databases and tablesMarek Chlup19 Aug
  • Using symbolic links for databases and tablesJani Tolonen20 Aug
    • Re: Using symbolic links for databases and tablesPaul DuBois20 Aug
  • Re: Using symbolic links for databases and tablesMarek Chlup20 Aug
  • Re: Using symbolic links for databases and tablesScott Hess20 Aug
    • Re: Using symbolic links for databases and tablesPaul DuBois20 Aug
      • Re: Using symbolic links for databases and tablescshepard20 Aug
      • Re: Using symbolic links for databases and tablesMichael Widenius23 Aug
  • Re: Using symbolic links for databases and tablesScott Hess20 Aug