List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:November 25 2009 11:12am
Subject:Re: question regarding mysql database location
View as plain text  
On Wed, Nov 25, 2009 at 11:55 AM, Manasi Save <
manasi.save@stripped> wrote:

> Hi Johan,
>
> I am Sorry. If I have complicated the senerio But, this still not fix my
> purpose.
>
> What I want is - From your example :-
>
> /data/disk1/mysql/db1 (directory)
>                 /db2 (directory)
>                 /db3 (directory)
>                 /db4 (symlink to /data/disk2/mysql/db4)
>                 /db5 (symlink to /data/disk2/mysql/db5)
>                 /db6 (symlink to /data/disk2/mysql/db6)
>
> I dont want to create these directories here (/data/disk1/mysql/d4
> /d5
> /d6).


They're not directories, they're symlinks, which are (to the OS) a kind of
file, and thus not limited to 32000 per directory. They behave mostly
identical to a directory, though, so MySQL will pick them up seamlessly,
with the one hitch that you'll have to replace "create database" statements
by mkdir and ln calls on the OS level.

This is afaik the only way to do this on the MySQL level. It is impossible
to specify multiple base directories.

Another possible option, but higher in complexity and most likely less
performant, would be to run two instances of MySQL on different ports with
different data directories, and use MySQL Proxy to redirect incoming
connections based on whatever criterion you could script into it - "use
database" statements, for example. This is however going to come with it's
very own set of catches and limitations.

I'm not big on proxy, myself, so I'm afraid if the symlink option is not
acceptable to you, I can't help you any further.

Thread
question regarding mysql database locationManasi Save25 Nov
  • Re: question regarding mysql database locationWaynn Lue25 Nov
    • Re: question regarding mysql database locationManasi Save25 Nov
      • Re: question regarding mysql database locationWaynn Lue25 Nov
        • Re: question regarding mysql database locationManasi Save25 Nov
          • Re: question regarding mysql database locationJohan De Meersman25 Nov
            • Re: question regarding mysql database locationManasi Save25 Nov
              • Re: question regarding mysql database locationJohan De Meersman25 Nov
                • Re: question regarding mysql database locationManasi Save25 Nov
                • Re: question regarding mysql database locationManasi Save25 Nov
                  • Re: question regarding mysql database locationJohan De Meersman25 Nov
                    • Re: question regarding mysql database locationManasi Save27 Nov
                  • Re: question regarding mysql database locationnitin mehta26 Nov
                    • Re: question regarding mysql database locationManasi Save27 Nov
  • Re: question regarding mysql database locationKrishna Chandra Prajapati25 Nov
    • Re: question regarding mysql database locationJohan De Meersman25 Nov
Re: question regarding mysql database locationManasi Save25 Nov