URGENT: Change Default Location of where Database Files get written?
URGENT: Change Default Location of where Database Files get written?
am 13.05.2011 17:21:56 von Tina Matter
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
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
RE: URGENT: Change Default Location of where Database Files getwritten?
am 13.05.2011 17:23:48 von David Brian Chait
Add:
datadir=3D/path/to/datadir/mysql
to your my.cnf file and restart mysql.
-----Original Message-----
From: Tina Matter [mailto:tinab@umich.edu]=20
Sent: Friday, May 13, 2011 8:22 AM
To: mysql@lists.mysql.com
Subject: URGENT: Change Default Location of where Database Files get writte=
n?
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)=20
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=20
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
--=20
Tina Matter
Web Applications Developer
University of Michigan
Department of Epidemiology
1415 Washington Heights, Suite 4605
Ann Arbor, MI 48109
--=20
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Ddchait@invenda.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: URGENT: Change Default Location of where Database Files get written?
am 13.05.2011 17:34:40 von mussatto
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
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: URGENT: Change Default Location of where Database Files get written?
am 13.05.2011 17:35:08 von Larry.Martell
On Fri, May 13, 2011 at 9:21 AM, 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) get=
s
> 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 record=
s
> in it,
> so it needs to be in a specific place.
>
> I want the database folder to get created here:
>
> /science/databases/databasename
http://lmgtfy.com/?q=3Dmysql+location+of+database+files
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: URGENT: Change Default Location of where Database Files get written?
am 13.05.2011 19:39:19 von Andrew Moore
--20cf300e527511933e04a32bc970
Content-Type: text/plain; charset=ISO-8859-1
There absolutely is;
there is a configuration file belonging to MySQL named `my.cnf`. It can
exist in many places and there's a hierarchal order of precedense. The most
common of which is /etc/my.cnf.
Within this file you may specify the `datadir` option to identify location
you wish your data to reside. This is a static variable that can't be
altered whilst the server is in motion and there are things you may need to
do before considering changing this value. There is a wealth of
documentation on this configuration file that can be found at...
http://dev.mysql.com/doc/refman/5.5/en/mysqld-option-tables. html
HTH
Andy
On Fri, May 13, 2011 at 4:21 PM, 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
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=eroomydna@gmail.com
>
>
--20cf300e527511933e04a32bc970--