List:General Discussion« Previous MessageNext Message »
From:Wm Mussatto Date:May 13 2011 3:34pm
Subject:Re: URGENT: Change Default Location of where Database Files get
written?
View as plain text  
On Fri, May 13, 2011 08:21, Tina Matter wrote:
> I have a MySQL question that I'm hoping someone can help answer.
>
> We have a linux machine which has MySQL 5.5.8 installed.
> It is currently installed in this location:    /opt/mysql
>
> When creating a new database, a folder (with the name of the databas)
> gets created in this location:
> /opt/mysql/data
>
> Is there any way to change the location of where data is stored?
> The database that I need to create is going to have over a billion
> records in it,
> so it needs to be in a specific place.
>
> I want the database folder to get created here:
>
> /science/databases/databasename
>
> Thanks for any help.
> Tina
>
> --
> Tina Matter
> Web Applications Developer
> University of Michigan
> Department of Epidemiology
> 1415 Washington Heights, Suite 4605
> Ann Arbor, MI 48109
Since your are on a linux box, the simplest method is to create the
database, but no tables and then replace the directory with a symbolic
link to the desired location.  Make sure the permissions at the new
directory match that of the other directories.  If you are using innodb
you will need to set it to use separate files for each table.

Hope this helps.

------
William R. Mussatto
Systems Engineer
http://www.csz.com
909-920-9154

Thread
URGENT: Change Default Location of where Database Files get written?Tina Matter13 May
  • RE: URGENT: Change Default Location of where Database Files getwritten?David Brian Chait13 May
  • Re: URGENT: Change Default Location of where Database Files get written?Wm Mussatto13 May
  • Re: URGENT: Change Default Location of where Database Files get written?Larry Martell13 May
  • Re: URGENT: Change Default Location of where Database Files get written?Andrew Moore13 May