List:General Discussion« Previous MessageNext Message »
From:Suresh Kuna Date:January 29 2010 7:57am
Subject:Re: How to change mysql default database directory
View as plain text  
Carlos - Follow the below steps

1) stop the mysqld service
2) copy the current datadir to your required location ex : D:\\datadirpath
3) Edit the my.ini by placing the option in mysqld section as
datadir=D:\\datadirpath
4) save the my.ini
5) start the mysqld service

It will use your new datadir and the newly created and old databases use the
same datadir


Thanks
Suresh Kuna
MySQL DBA

On Fri, Jan 29, 2010 at 9:22 AM, Carlos Proal <carlos.proal@stripped>wrote:

> As Suresh and others said, you have to stop the dbms, move to content of
> the dir and restart the dbms.
>
> Also, if you have a fresh install, innodb tables will be saved on a
> datafile inside the same data dir, but if is not a fresh install you may
> have innodb variables (ie. innodb_data_home_dir) in the config file, and you
> may need to change those too.
>
> Carlos
>
> On 1/28/2010 9:25 PM, Lucky Wijaya wrote:
>
>> Is that all ? So, if i changed datadir on the config file, whenever i
>> create databases mysql will store it on selected directory ? How about the
>> created-before database ?
>>
>> Btw, I'm using Windows.
>>
>> Thanks in advance.
>>
>> ------------------------------------------------------------------------
>> *From:* Carlos Proal <carlos.proal@stripped>
>> *To:* mysql@stripped
>> *Sent:* Fri, January 29, 2010 10:16:31 AM
>> *Subject:* Re: How to change mysql default database directory
>>
>>
>>
>> Absolutely, check for the variable "datadir" on the config file (my.ini
>> on windows and my.cnf on *nix).
>>
>> Carlos
>>
>> On 1/28/2010 9:12 PM, Lucky Wijaya wrote:
>> > Hi all,
>> >
>> > I've installed MySQL on 320GB Harddisk (partitioned into 3 partitions).
>> I want to know if there's a way to change MySQL default database directory
>> from C: to D:.
>> >
>> > Thanks.
>> >
>> >
>> >
>> >
>> >
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:
>> http://lists.mysql.com/mysql?unsub=1
>>
>>
>>
>


-- 
Thanks
Suresh Kuna
MySQL DBA

Thread
How to change mysql default database directoryLucky Wijaya29 Jan
  • Re: How to change mysql default database directoryCarlos Proal29 Jan
  • Re: How to change mysql default database directoryprabhat kumar29 Jan
Re: How to change mysql default database directorysureshkumarilu29 Jan
Re: How to change mysql default database directoryCarlos Proal29 Jan
  • Re: How to change mysql default database directorySuresh Kuna29 Jan