Discussion:
Change datadir in my.cnf
(too old to reply)
p***@warpstudio.ch
2007-01-30 09:29:51 UTC
Permalink
Hi,

I would like to move my DBs in another directory.
I know that I have to change in my.cnf the datadir path ....

[mysqld]
datadir=/var/lib/mysql

-> datadir=/user/mysql/databases

now my question is, can I simple copy all my DBs to the new datadir,
and then restart mysql server ?
Or is there something to take care ?


Thanks a lot
JP
Carl Pearson
2007-01-30 13:24:30 UTC
Permalink
Post by p***@warpstudio.ch
Hi,
I would like to move my DBs in another directory.
I know that I have to change in my.cnf the datadir path ....
[mysqld]
datadir=/var/lib/mysql
-> datadir=/user/mysql/databases
now my question is, can I simple copy all my DBs to the new datadir,
and then restart mysql server ?
Or is there something to take care ?
Thanks a lot
JP
It's pretty straightforward, the big thing is to make sure permissions
are set appropriately in the new location. Here's one of many
walk-throughs:

http://rajshekhar.net/blog/archives/90-Moving-the-MySQLs-datadir-directory..html
Loading...