List:General Discussion« Previous MessageNext Message »
From:Shawn Green (MySQL) Date:September 3 2010 3:05am
Subject:Re: Symlinks not working when pointing to another table.
View as plain text  
On 9/2/2010 3:31 PM, Julien Lory wrote:
>  Hello,
> 
> I've done lot of researches and tests but can't find any answer. I need 
> to share one table between two db, those two db are in the same path ( 
> /var/lib/mysql/db1 & db2 ). I created symbolic links for db2 pointing to 
> the table in db1.
> When I query the table from db2 I get this error :
> 'ERROR 1030 (HY000): Got error 140 from storage engine'
> I'm sure it was working in previous version of MySQL, but from the last 
> version it's no longer working.
> 
> This is how it looks :
> 
> test-lan:/var/lib/mysql/test3# ls -alh
> drwx------ 2 mysql mysql 4.0K 2010-08-30 13:28 .
> drwxr-xr-x 6 mysql mysql 4.0K 2010-08-30 13:29 ..
> lrwxrwxrwx 1 mysql mysql 28 2010-08-30 13:28 blbl.frm ->  
> /var/lib/mysql/test/blbl.frm
> lrwxrwxrwx 1 mysql mysql 28 2010-08-30 13:28 blbl.MYD ->  
> /var/lib/mysql/test/blbl.MYD
> lrwxrwxrwx 1 mysql mysql 28 2010-08-30 13:28 blbl.MYI ->  
> /var/lib/mysql/test/blbl.MYI
> -rw-rw---- 1 mysql mysql 65 2010-08-30 13:24 db.opt
> 
> 
> I really need those symlinks, is there a way to make them working like 
> before ? ( old MySQL-server is fine )
> 

You cannot share one set of files (one table) between two different 
MySQL instances. That also means that you cannot share a table between 
the same instance by pretending it's something else by a symlink. The 
storage engines are designed with the premise that they have exclusive 
domain over the files they manage. Sharing is not part of their code.

If you need to expose a table from within a different database, you must 
use a view.

-- 
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc.
Office: Blountville, TN
Thread
Symlinks not working when pointing to another table.Julien Lory2 Sep
  • RE: Symlinks not working when pointing to another table.Daevid Vincent2 Sep
    • Re: Symlinks not working when pointing to another table.Julien Lory2 Sep
  • Re: Symlinks not working when pointing to another table.MySQL)3 Sep