views:

88

answers:

1

Hi All,

Is it possible, if I change my default mysql data directory to other. But, will I be able to access the databases from old location.

any inputs will be a great help.

Thanks in advance

Regards, Manasi

A: 

you would have to copy the current data to the new directory and to change your my.cnf your MySQL.

[mysqld]
datadir=/your/new/dir/
tmpdir=/your/new/temp/

You have to copy the database when the server is not running.

RageZ
Well thats what I cannot do. I want to change the directory but I want to create new databases in new directory. And Want to access both old directory and new directory databases.
MySQL DBA
@MySQL DBA: if you use some `ln -s` static symbolic lynx won't that make it ?
RageZ
Well I am bit confused with the use of this command. As I explained before I want to create new databases in new directory. Is it possible with symlink.
MySQL DBA
you can create a new directory, use symbolic link to make the file appear in the new dir and change your `my.cnf`
RageZ
yes but then in that case mysql is not reading the symlinks. I have done this but I cannot read those symlinks as databases.
MySQL DBA
@MySQL DBQ: so means that's pretty much impossible.
RageZ
I am sorry RageZ. MySQL is able to read symlinks and can be used as a database. Thanks for all your help.
MySQL DBA